osvenskan <osvens...@users.sourceforge.net> added the comment: 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. Added file: http://bugs.python.org/file12391/explore_sem_value_max.c _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue3110> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com