Bug 469744: Implement PR_OpenSemaphore with System V semaphores on Mac OS
authorwtc%google.com
Tue, 16 Dec 2008 00:21:46 +0000
changeset 4021 9921002395c846ccf2fa6ce7e4a2effef6296dfa
parent 4020 6cc4843e327b79b6aa2904585ca4ce70d8dc7f87
child 4022 6f13e13c5559cab0b7ee5b92f6b4dd5dcaed0eb0
push idunknown
push userunknown
push dateunknown
bugs469744
Bug 469744: Implement PR_OpenSemaphore with System V semaphores on Mac OS X. TBR=glen.beasley. Modified files: _darwin.h ptsynch.c
pr/include/md/_darwin.h
pr/src/pthreads/ptsynch.c
--- a/pr/include/md/_darwin.h
+++ b/pr/include/md/_darwin.h
@@ -67,16 +67,17 @@
 #ifdef __x86_64__
 #define USE_DLFCN
 #else
 #define USE_MACH_DYLD
 #endif
 #define _PR_HAVE_SOCKADDR_LEN  
 #define _PR_STAT_HAS_ST_ATIMESPEC
 #define _PR_HAVE_LARGE_OFF_T
+#define _PR_HAVE_SYSV_SEMAPHORES
 #define PR_HAVE_SYSV_NAMED_SHARED_MEMORY
 
 #define _PR_INET6
 /*
  * I'd prefer to use getipnodebyname and getipnodebyaddr but the
  * getipnodebyname(3) man page on Mac OS X 10.2 says they are not
  * thread-safe.  AI_V4MAPPED|AI_ADDRCONFIG doesn't work either.
  */
--- a/pr/src/pthreads/ptsynch.c
+++ b/pr/src/pthreads/ptsynch.c
@@ -807,17 +807,17 @@ PR_IMPLEMENT(PRStatus) PR_DeleteSemaphor
 #include <fcntl.h>
 #include <sys/sem.h>
 
 /*
  * From the semctl(2) man page in glibc 2.0
  */
 #if (defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED)) \
     || defined(FREEBSD) || defined(OPENBSD) || defined(BSDI) \
-    || defined(SYMBIAN)
+    || defined(DARWIN) || defined(SYMBIAN)
 /* union semun is defined by including <sys/sem.h> */
 #else
 /* according to X/OPEN we have to define it ourselves */
 union semun {
     int val;
     struct semid_ds *buf;
     unsigned short  *array;
 };