summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJesse Noller <jnoller@gmail.com>2009-04-02 02:32:55 (GMT)
committerJesse Noller <jnoller@gmail.com>2009-04-02 02:32:55 (GMT)
commitb502bc7a1a1f7038f9fc0fd8cd3c1e65d45ad694 (patch)
tree6148f99947bf908a6a922a0d31564a04da4a0c78 /Modules
parent569fc96f99db02e7b16eb0587031469d08caa719 (diff)
downloadcpython-b502bc7a1a1f7038f9fc0fd8cd3c1e65d45ad694.zip
cpython-b502bc7a1a1f7038f9fc0fd8cd3c1e65d45ad694.tar.gz
cpython-b502bc7a1a1f7038f9fc0fd8cd3c1e65d45ad694.tar.bz2
Issue 3110: Additional protection for SEM_VALUE_MAX on platforms, thanks to Martin Loewis
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_multiprocessing/multiprocessing.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index f6ab994..f8750d2 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -45,13 +45,18 @@
* Issue 3110 - Solaris does not define SEM_VALUE_MAX
*/
#ifndef SEM_VALUE_MAX
-# ifdef _SEM_VALUE_MAX
-# define SEM_VALUE_MAX _SEM_VALUE_MAX
-# else
-# define SEM_VALUE_MAX INT_MAX
-# endif
+ #if defined(HAVE_SYSCONF) && defined(_SC_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX sysconf(_SC_SEM_VALUE_MAX)
+ #elif defined(_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX _SEM_VALUE_MAX
+ #elif definef(_POSIX_SEM_VALUE_MAX)
+ # define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX
+ #else
+ # define SEM_VALUE_MAX INT_MAX
+ #endif
#endif
+
/*
* Make sure Py_ssize_t available
*/