diff options
Diffstat (limited to 'libc/misc/sysvipc')
-rw-r--r-- | libc/misc/sysvipc/ipc.h | 4 | ||||
-rw-r--r-- | libc/misc/sysvipc/msgq.c | 14 | ||||
-rw-r--r-- | libc/misc/sysvipc/shm.c | 14 |
3 files changed, 20 insertions, 12 deletions
diff --git a/libc/misc/sysvipc/ipc.h b/libc/misc/sysvipc/ipc.h index e1b94ad12..a5d443543 100644 --- a/libc/misc/sysvipc/ipc.h +++ b/libc/misc/sysvipc/ipc.h @@ -2,10 +2,10 @@ #define IPC_H #include <syscall.h> -#ifdef __NR_ipc - #define __IPC_64 0x100 +#ifdef __NR_ipc + /* The actual system call: all functions are multiplexed by this. */ extern int __syscall_ipc __P((int __call, int __first, int __second, int __third, void *__ptr)); diff --git a/libc/misc/sysvipc/msgq.c b/libc/misc/sysvipc/msgq.c index 411ea3ea4..758dbaa47 100644 --- a/libc/misc/sysvipc/msgq.c +++ b/libc/misc/sysvipc/msgq.c @@ -6,14 +6,18 @@ #ifdef L_msgctl #ifdef __NR_msgctl -_syscall3(int, msgctl, int, msqid, int, cmd | __IPC_64, struct msqid_ds *, buf); -#else +#define __NR___libc_msgctl __NR_msgctl +_syscall3(int, __libc_msgctl, int, msqid, int, cmd, struct msqid_ds *, buf); +#endif /* Message queue control operation. */ -int msgctl (int msqid, int cmd, struct msqid_ds *buf) +int msgctl(int msqid, int cmd, struct msqid_ds *buf) { - return __syscall_ipc(IPCOP_msgctl ,msqid ,cmd | __IPC_64 ,0 ,buf); -} +#ifdef __NR_msgctl + return __libc_msgctl(msqid, cmd | __IPC_64, buf); +#else + return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf); #endif +} #endif diff --git a/libc/misc/sysvipc/shm.c b/libc/misc/sysvipc/shm.c index d21d9f54b..29f3178d6 100644 --- a/libc/misc/sysvipc/shm.c +++ b/libc/misc/sysvipc/shm.c @@ -48,13 +48,17 @@ void * shmat (int shmid, const void *shmaddr, int shmflg) #ifdef L_shmctl /* Provide operations to control over shared memory segments. */ #ifdef __NR_shmctl -_syscall3(int, shmctl, int, shmid, int, cmd | __IPC_64, struct shmid_ds *, buf); -#else -int shmctl (int shmid, int cmd, struct shmid_ds *buf) +#define __NR___libc_shmctl __NR_shmctl +_syscall3(int, __libc_shmctl, int, shmid, int, cmd, struct shmid_ds *, buf); +#endif +int shmctl(int shmid, int cmd, struct shmid_ds *buf) { - return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64 , 0, buf); -} +#ifdef __NR_shmctl + return __libc_shmctl(shmid, cmd | __IPC_64, buf); +#else + return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf); #endif +} #endif |