summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>1999-08-25 16:53:57 +0000
committerSascha Schumann <sas@php.net>1999-08-25 16:53:57 +0000
commit33ed504ef4f4729eb728c65e5d6f4ea0c9ac05fb (patch)
tree12d2b2a5ffa22341096b059862743c5c97e3e969
parent7a9ad9d0c81ef11fa05a69c1819c4377c4b93cd0 (diff)
downloadphp-git-33ed504ef4f4729eb728c65e5d6f4ea0c9ac05fb.tar.gz
AIX wants the value, not the pointer to the value.
Fixes #2149
-rw-r--r--ext/sysvsem/sysvsem.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index 05c6a8b5e4..a15bf6bcdb 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -121,6 +121,11 @@ int php3_minit_sysvsem(INIT_FUNC_ARGS)
return SUCCESS;
}
+#define SETVAL_WANTS_PTR
+
+#if defined(_AIX)
+#undef SETVAL_WANTS_PTR
+#endif
/* {{{ proto int sem_get(int key [, int max_acquire [, int perm]])
Return an id for the semaphore with the given key, and allow max_acquire (default 1) processes to acquire it simultaneously. */
@@ -237,11 +242,16 @@ PHP_FUNCTION(sysvsem_get)
if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));
}
-#else
+#elif defined(SETVAL_WANTS_PTR)
/* This is correct for Solaris 2.6 which does not have union semun. */
if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) {
php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));
}
+#else
+ /* This works for i.e. AIX */
+ if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
+ php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));
+ }
#endif
}