Bug #2149: System V semaphores do not work properly
| From: | mcafee at umich dot edu | Date: | Wed, 25 Aug 1999 16:46:11 +0000 |
| Subject: | Bug #2149: System V semaphores do not work properly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-10191@lists.php.net to get a copy of this message | ||
From: mcafee@umich.edu
Operating system: AIX 4.2
PHP version: 3.0.12
PHP Bug Type: Other
Bug description: System V semaphores do not work properly
<? $sem = sem_get(999); ?>
This results in the following error on AIX 4.2:
Warning: semctl(SETVAL) failed for key 0x3e7: Result too large in /home/nsadmin/apache/htdocs/a.php
on line 1
This is because of the following system call in functions/sysvsem.c:
semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire)
AIX's semctl expects the SETVAL value to be passed directly as the fourth argument, not
indirectly via pointer.
The fix is very simple; just replace the code that reads
#if HAVE_SEMUN
...
#else
...
#endif
with
#if defined(_AIX)
... /* same as #else case, but remove ampersand before max_acquire */
#elif HAVE_SEMUN
...
#else
...
#endif
The fix is trivial, but I'd be happy to submit a patch if necessary.