buf = &tmp;
}
#endif
-#ifdef SYS_msgctl
+#ifndef SYS_ipc
int r = __syscall(SYS_msgctl, q, cmd | IPC_64, buf);
#else
int r = __syscall(SYS_ipc, IPCOP_msgctl, q, cmd | IPC_64, 0, buf, 0);
int msgget(key_t k, int flag)
{
-#ifdef SYS_msgget
+#ifndef SYS_ipc
return syscall(SYS_msgget, k, flag);
#else
return syscall(SYS_ipc, IPCOP_msgget, k, flag);
ssize_t msgrcv(int q, void *m, size_t len, long type, int flag)
{
-#ifdef SYS_msgrcv
+#ifndef SYS_ipc
return syscall_cp(SYS_msgrcv, q, m, len, type, flag);
#else
return syscall_cp(SYS_ipc, IPCOP_msgrcv, q, len, flag, ((long[]){ (long)m, type }));
int msgsnd(int q, const void *m, size_t len, int flag)
{
-#ifdef SYS_msgsnd
+#ifndef SYS_ipc
return syscall_cp(SYS_msgsnd, q, m, len, flag);
#else
return syscall_cp(SYS_ipc, IPCOP_msgsnd, q, len, flag, m);
arg.buf = &tmp;
}
#endif
-#ifdef SYS_semctl
+#ifndef SYS_ipc
int r = __syscall(SYS_semctl, id, num, cmd | IPC_64, arg.buf);
#else
int r = __syscall(SYS_ipc, IPCOP_semctl, id, num, cmd | IPC_64, &arg.buf);
* n fits in the correct (per POSIX) userspace type, so
* we have to check here. */
if (n > USHRT_MAX) return __syscall_ret(-EINVAL);
-#ifdef SYS_semget
+#ifndef SYS_ipc
return syscall(SYS_semget, key, n, fl);
#else
return syscall(SYS_ipc, IPCOP_semget, key, n, fl);
int semop(int id, struct sembuf *buf, size_t n)
{
-#ifdef SYS_semop
+#ifndef SYS_ipc
return syscall(SYS_semop, id, buf, n);
#else
return syscall(SYS_ipc, IPCOP_semop, id, n, 0, buf);
int semtimedop(int id, struct sembuf *buf, size_t n, const struct timespec *ts)
{
-#ifdef SYS_semtimedop
+#ifndef SYS_ipc
return syscall(SYS_semtimedop, id, buf, n, ts);
#else
return syscall(SYS_ipc, IPCOP_semtimedop, id, n, 0, buf, ts);
#include "syscall.h"
#include "ipc.h"
-#ifdef SYS_shmat
+#ifndef SYS_ipc
void *shmat(int id, const void *addr, int flag)
{
return (void *)syscall(SYS_shmat, id, addr, flag);
buf = &tmp;
}
#endif
-#ifdef SYS_shmctl
+#ifndef SYS_ipc
int r = __syscall(SYS_shmctl, id, cmd | IPC_64, buf);
#else
int r = __syscall(SYS_ipc, IPCOP_shmctl, id, cmd | IPC_64, 0, buf, 0);
int shmdt(const void *addr)
{
-#ifdef SYS_shmdt
+#ifndef SYS_ipc
return syscall(SYS_shmdt, addr);
#else
return syscall(SYS_ipc, IPCOP_shmdt, 0, 0, 0, addr);
int shmget(key_t key, size_t size, int flag)
{
if (size > PTRDIFF_MAX) size = SIZE_MAX;
-#ifdef SYS_shmget
+#ifndef SYS_ipc
return syscall(SYS_shmget, key, size, flag);
#else
return syscall(SYS_ipc, IPCOP_shmget, key, size, flag);