Message78006
I'm facing the same problem (getting a good definition of SEM_VALUE_MAX)
for my posix_ipc extension. The patch presented here will get the
compiler to shut up on OpenSolaris, but not for the reason you think. At
least, that's the way I see it.
On OpenSolaris (2008.05 is what I'm testing with), _SEM_VALUE_MAX is
indeed #defined in sys/param.h, but it's inside this #ifdef on line 322:
#if (defined(_KERNEL) || defined(_KMEMUSER))
Since multiprocessing.c doesn't #define either of these, both
SEM_VALUE_MAX and _SEM_VALUE_MAX will remain undefined and so the patch
will always fall back to INT_MAX.
IMHO, given the choice between #defining _KERNEL or _KMEMUSER and
calling sysconf(_SC_SEM_VALUE_MAX), I feel safer doing the latter.
I did a survey of all the operating systems to which I have access
(OpenSolaris 2008.05, OS X 10.5.5, RHEL?, Ubuntu 8.04, and FreeBSD 7).
OpenSolaris is the only one that doesn't #define SEM_VALUE_MAX, and on
all systems except for the possibly Red Hattish one,
sysconf(_SC_SEM_VALUE_MAX) returned the same value as the definition of
SEM_VALUE_MAX. I attached my code & results. |
|
Date |
User |
Action |
Args |
2008-12-18 01:50:48 | osvenskan | set | recipients:
+ osvenskan, loewis, skip.montanaro, pitrou, roudkerk, jnoller |
2008-12-18 01:50:47 | osvenskan | set | messageid: <1229565047.91.0.506945532267.issue3110@psf.upfronthosting.co.za> |
2008-12-18 01:50:47 | osvenskan | link | issue3110 messages |
2008-12-18 01:50:46 | osvenskan | create | |
|