Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2005-04-04 19:51:30

"Jonathan Wakely" <cow_at_[hidden]> wrote in message

> Out of interest, why can't you just use _SC_THREAD_SAFE_FUNCTIONS if it's
> defined?
> Also, if _POSIX_THREAD_SAFE_FUNCTIONS == 0, I thought that meant *not*
> supported (in which case sysconf() would return -1) ? Does the test have
> to be >= not just > ?
> I'd have written it:
> if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) > 0 )
> { return ::readdir_r( dirp, entry, result ); }
> # endif
> But I didn't realise this wasn't good enough :-|

This is the first time I've ever used the POSIX config mechanisms, so I may
have it wrong. I'll check... Hum... I find the POSIX docs for sysconf()
pretty impeneratable regarding the return value. I can see why I took >=0 to
be needed, but I could also read it in a way that >0 would be OK.

Any POSIX experts out there?

> Finally, readdir_r() is available on FreeBSD even though neither
> I don't know how to test for it though, FreeBSD's sysconf() only claims
> to support POSIX 1990, even though some later interfaces are available.

Someone with access to that system needs to figure out what PP macro to look



Boost list run by bdawes at, gregod at, cpdaniel at, john at