This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _POSIX_SEMAPHORES checked incorrectly
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: anthonybaxter Nosy List: anthonybaxter, bob.ippolito, loewis
Priority: normal Keywords: patch

Created on 2005-03-14 20:27 by bob.ippolito, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg47975 - (view) Author: Bob Ippolito (bob.ippolito) * (Python committer) Date: 2005-03-14 20:27
The POSIX spec states that these may be defined as (-1) to state 
non-compliance.  Python doesn't respect that.  This patch (against 
2.4.1rc1, CVS is borked) fixes that.

Without this patch, Python will not work on "some operating 
systems" unless threading is disabled entirely.
msg47976 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2005-03-15 23:00
Logged In: YES 
user_id=21627

The attached file appears not to be a patch file, but a file
containing a single line

/Volumes/Crack/download/posix_semaphores-2.4.1rc1.patch
msg47977 - (view) Author: Bob Ippolito (bob.ippolito) * (Python committer) Date: 2005-03-15 23:08
Logged In: YES 
user_id=139309

uh oh, must be another bug in the OS I'm using (or sourceforge)...

Hopefully this is suitable for now, the patch is near trivial anyway:

--- Python-2.4.1c1/Python/thread_pthread.h  2004-07-07 
13:44:12.000000000 -0400
+++ /Users/bob/src/Python-2.4.1c1/Python/thread_pthread.h   
2005-03-14 14:54:00.000000000 -0500
@@ -16,9 +16,13 @@
    family of functions must indicate this by defining
    _POSIX_SEMAPHORES. */
 #ifdef _POSIX_SEMAPHORES
+#if _POSIX_SEMAPHORES == -1
+#define HAVE_BROKEN_POSIX_SEMAPHORES
+#else
 #include <semaphore.h>
 #include <errno.h>
 #endif
+#endif

 #if !defined(pthread_attr_default)
 #  define pthread_attr_default ((pthread_attr_t *)NULL)
msg47978 - (view) Author: Anthony Baxter (anthonybaxter) (Python triager) Date: 2005-03-16 04:15
Logged In: YES 
user_id=29957

Checked in on the 2.4 branch and the trunk. Thanks for the
patch!
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41698
2005-03-14 20:27:47bob.ippolitocreate