
Hello, currently the filesystem library doesn't compile on Tru64 5.1 using gcc-3.4.3 as the compiler. schoepf@area51:~/net/src/boost/boost-HEAD/tools/regression/build> bjam -sTOOLS=gcc ...found 752 targets... ...using 3 temp targets... ...updating 4 targets... ...using <@boost!libs!filesystem!build/libboost_filesystem.a/gcc/release>exception.o... gcc-C++-action ../../../bin/boost/libs/filesystem/build/libboost_filesystem.a/gcc/release/operations_posix_windows.o /net/users/schoepflin/src/boost/boost-HEAD/libs/filesystem/build/../src/operations_posix_windows.cpp:123:39: operator '&&' has no right operand set -e "g++" -c -Wall -ftemplate-depth-255 -DNDEBUG -DNDEBUG -O3 -finline-functions -Wno-inline -I"../../../bin/boost/libs/filesystem/build" -I"/net/users/schoepflin/src/boost/boost-HEAD" -I "/net/users/schoepflin/src/boost/boost-HEAD" -o "../../../bin/boost/libs/filesystem/build/libboost_filesystem.a/gcc/release/operations_posix_windows.o" "/net/users/schoepflin/src/boost/boost-HEAD/libs/filesystem/build/../src/operations_posix_windows.cpp" The code in question is: # if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && defined(_SC_THREAD_SAFE_FUNCTIONS) \ && _POSIX_THREAD_SAFE_FUNCTIONS >= 0 if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) >= 0 ) { return ::readdir_r( dirp, entry, result ); } # endif Seems like _POSIX_THREAD_SAFE_FUNCTIONS but doesn't expand to anything. Markus

The code in question is:
# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && defined(_SC_THREAD_SAFE_FUNCTIONS) \ && _POSIX_THREAD_SAFE_FUNCTIONS >= 0 if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) >= 0 ) { return ::readdir_r( dirp, entry, result ); } # endif
Seems like _POSIX_THREAD_SAFE_FUNCTIONS but doesn't expand to anything.
That's a common problem with the POSIX feature test macros, the workaround is to use : (_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0) John.

John Maddock wrote:
The code in question is:
# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && defined(_SC_THREAD_SAFE_FUNCTIONS) \ && _POSIX_THREAD_SAFE_FUNCTIONS >= 0 if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) >= 0 ) { return ::readdir_r( dirp, entry, result ); } # endif
Seems like _POSIX_THREAD_SAFE_FUNCTIONS but doesn't expand to anything.
That's a common problem with the POSIX feature test macros, the workaround is to use :
(_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0)
Fixed and commited. Thanks for the hint. Markus

Markus, do you plan to publish the regressiont tests for Tru64? It'd be fine to have those for the upcoming release. Also, I think you were in charge of IBM Visual Age, weren't you? Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Markus Schöpflin ha escrito:
John Maddock wrote:
The code in question is:
# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && defined(_SC_THREAD_SAFE_FUNCTIONS) \ && _POSIX_THREAD_SAFE_FUNCTIONS >= 0 if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) >= 0 ) { return ::readdir_r( dirp, entry, result ); } # endif
Seems like _POSIX_THREAD_SAFE_FUNCTIONS but doesn't expand to anything.
That's a common problem with the POSIX feature test macros, the workaround is to use :
(_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0)
Fixed and commited. Thanks for the hint.
Markus
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Joaquín Mª López Muñoz wrote:
Markus, do you plan to publish the regressiont tests for Tru64?
As I finally again have a machine where I can run the tests, I intend to do so, yes. I'm currently in the process of setting up the regression tests again. But as I'm not allowed to patch the system header files this time I'm not sure how far I will get with running the tests.
It'd be fine to have those for the upcoming release. Also, I think you were in charge of IBM Visual Age, weren't you?
Hmm, I remember darkly somthing about IBM Visual Age from my earlier life. :-) But this is years past, I don't have any dealings with IBM/AIX currently. Markus

On Mon, Apr 04, 2005 at 12:24:26PM +0100, John Maddock wrote:
The code in question is:
# if defined(_POSIX_THREAD_SAFE_FUNCTIONS) \ && defined(_SC_THREAD_SAFE_FUNCTIONS) \ && _POSIX_THREAD_SAFE_FUNCTIONS >= 0 if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) >= 0 ) { return ::readdir_r( dirp, entry, result ); } # endif
Seems like _POSIX_THREAD_SAFE_FUNCTIONS but doesn't expand to anything.
That's a common problem with the POSIX feature test macros, the workaround is to use :
(_POSIX_THREAD_SAFE_FUNCTIONS+0 >= 0)
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 defined(_SC_THREAD_SAFE_FUNCTIONS) if ( ::sysconf( _SC_THREAD_SAFE_FUNCTIONS ) > 0 ) { return ::readdir_r( dirp, entry, result ); } # endif But I didn't realise this wasn't good enough :-| Finally, readdir_r() is available on FreeBSD even though neither _POSIX_THREAD_SAFE_FUNCTIONS not _SC_THREAD_SAFE_FUNCTIONS is defined. 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. jon

"Jonathan Wakely" <cow@compsoc.man.ac.uk> wrote in message news:20050404134320.GA88664@compsoc.man.ac.uk...
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 defined(_SC_THREAD_SAFE_FUNCTIONS) 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 _POSIX_THREAD_SAFE_FUNCTIONS not _SC_THREAD_SAFE_FUNCTIONS is defined. 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 for. Thanks, --Beman

On Mon, 4 Apr 2005 20:51:30 -0400, Beman Dawes wrote
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 _POSIX_THREAD_SAFE_FUNCTIONS not _SC_THREAD_SAFE_FUNCTIONS is defined. 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 for.
Once we get this figured out, I'd like to put this into the config library. I need this config info in date-time and it looks like the filesystem and time access functions normally use the same macro (at least for this platform). I'd suggest something like: BOOST_HAS_POSIX_THREAD_SAFE_FUNCTIONS No hurry -- we should wait until after 1.33 when there is less chance of perturbing the release ;-) Jeff

On Mon, Apr 04, 2005 at 08:51:30PM -0400, Beman Dawes wrote:
"Jonathan Wakely" <cow@compsoc.man.ac.uk> wrote in message news:20050404134320.GA88664@compsoc.man.ac.uk...
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 defined(_SC_THREAD_SAFE_FUNCTIONS) 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.
_POSIX_THREAD_SAFE_FUNCTIONS [TSF] The implementation supports the Thread-Safe Functions option. If this symbol is defined in <unistd.h>, it shall be defined to be -1, 0, or 200112L. The value of this symbol reported by sysconf() shall either be -1 or 200112L. That's not to say that there aren't implementations that return 0, to indiciate partial support (even though that's non-conforming.)
Any POSIX experts out there?
My understanding is from Marc Rochkind's "Advanced UNIX Programming" which is pretty thoroughly tested on Solaris, FreeBSD and Linux ... but I'm never surprised to learn Tru64 does things differently.
Finally, readdir_r() is available on FreeBSD even though neither _POSIX_THREAD_SAFE_FUNCTIONS not _SC_THREAD_SAFE_FUNCTIONS is defined. 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 for.
I have access ... but I can't figure it out ;) If _POSIX_SOURCE is not defined then the threadsafe functions are declared (to keep the namespace clean when _POSIX_SOURCE *is* declared) That's the case for FreeBSD 4.8 - 4.11, I don't know about anything else. There doesn't seem to be a positive feature test for the functions, only !defined(_POSIX_SOURCE) jon

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 defined(_SC_THREAD_SAFE_FUNCTIONS) 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?
Not really, but here's my understanding of how things work from when I last looked at this for the config system: For the current POSIX standard (see Base definitions, <unistd.h>): If _POSIX_FEATURE is defined as < 0 then the feature is never available on that platform. If _POSIX_FEATURE is defined as > 0 then the feature is always available on that platform. If _POSIX_FEATURE is defined as 0 then: "all headers, data types, and functions shall be present. The application can check at runtime to see whether the option is supported by calling fpathconf( ), pathconf( ), or sysconf( ) with the indicated name parameter." I've no idea about previous versions of the standard, except that it seems to be common place to define these feature test macros with no value, so I'm guessing we should treat these as the same as a value of zero. There are also some platforms that don't define a particular feature test macro, but none the less support at least some of the option. Note that if you want to follow the std strictly, then we can't avoid calls to fpathconf( ), pathconf( ), or sysconf( ) in every case, although can avoid it in many cases. HTH, John.

"Jonathan Wakely" <cow@compsoc.man.ac.uk> wrote in message news:20050404134320.GA88664@compsoc.man.ac.uk...
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 defined(_SC_THREAD_SAFE_FUNCTIONS) 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 _POSIX_THREAD_SAFE_FUNCTIONS not _SC_THREAD_SAFE_FUNCTIONS is defined. 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 for. Thanks, --Beman
participants (6)
-
Beman Dawes
-
Jeff Garland
-
Joaquín Mª López Muñoz
-
John Maddock
-
Jonathan Wakely
-
Markus Schöpflin