diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-08-25 00:08:23 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-08-25 00:08:23 +0000 |
commit | d7aaa51dffc2d29192b64b382590d6752c82c3a3 (patch) | |
tree | 83e9f0f38956f65cddae2e23c6e552224aad7b44 /libc/misc/sysvipc/sem.c | |
parent | e590469b10c9823ac8eabcbe73152c3a4c570421 (diff) |
Make shm stuff work properly.
-Erik
Diffstat (limited to 'libc/misc/sysvipc/sem.c')
-rw-r--r-- | libc/misc/sysvipc/sem.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libc/misc/sysvipc/sem.c b/libc/misc/sysvipc/sem.c index 46b4821a4..a3eaca7be 100644 --- a/libc/misc/sysvipc/sem.c +++ b/libc/misc/sysvipc/sem.c @@ -26,13 +26,13 @@ /* Return identifier for array of NSEMS semaphores associated with KEY. */ #include <stdarg.h> -/* Define a `union semun' suitable for Linux here. */ -union semun -{ +/* arg for semctl system calls. */ +union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */ - unsigned short int *array; /* array for GETALL & SETALL */ - struct seminfo *__buf; /* buffer for IPC_INFO */ + unsigned short *array; /* array for GETALL & SETALL */ + struct seminfo *__buf; /* buffer for IPC_INFO */ + void *__pad; }; @@ -41,18 +41,15 @@ union semun static inline _syscall4(int, __semctl, int, semid, int, semnum, int, cmd, union semun *, arg); #endif -int semctl (int semid, int semnum, int cmd, ...) +int semctl(int semid, int semnum, int cmd, ...) { union semun arg; - va_list ap; - - va_start (ap, cmd); + va_list ap; /* Get the argument. */ + va_start (ap, cmd); arg = va_arg (ap, union semun); - va_end (ap); - #ifdef __NR_semctl return __semctl(semid, semnum, cmd, &arg); #else |