separate syscalls.
-Erik
#ifdef L_msgctl
+
+#ifdef __NR_msgctl
+_syscall3(int, msgctl, int, msqid, int, cmd, struct msqid_ds *, buf);
+#else
/* Message queue control operation. */
int msgctl (int msqid, int cmd, struct msqid_ds *buf)
{
return __ipc(IPCOP_msgctl ,msqid ,cmd ,0 ,buf);
}
#endif
+#endif
#ifdef L_msgget
+#ifdef __NR_msgget
+_syscall2(int, msgget, key_t, key, int, msgflg)
+#else
/* Get messages queue. */
int msgget (key_t key, int msgflg)
{
return __ipc(IPCOP_msgget ,key ,msgflg ,0 ,0);
}
#endif
+#endif
struct new_msg_buf{
#ifdef L_msgrcv
+#ifdef __NR_msgrcv
+_syscall5(int, msgrcv, int, msqid, void *, msgp, size_t, msgsz, long int, msgtyp, int, msgflg);
+#else
int msgrcv (int msqid, void *msgp, size_t msgsz,
long int msgtyp, int msgflg)
{
return __ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp);
}
#endif
+#endif
#ifdef L_msgsnd
+#ifdef __NR_msgsnd
+_syscall4(int, msgsnd, int, msqid, const void *, msgp, size_t, msgsz, int, msgflg);
+#else
/* Send message to message queue. */
int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
{
return __ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp);
}
#endif
+#endif
#include <sys/sem.h>
#include "ipc.h"
+
#ifdef L_semctl
/* Return identifier for array of NSEMS semaphores associated with
KEY. */
};
-int
-semctl (int semid, int semnum, int cmd, ...)
+#ifdef __NR_semctl
+#define __NR___semctl __NR_semctl
+static inline _syscall4(int, __semctl, int, semid, int, semnum, int, cmd, union semun *, arg);
+#endif
+
+int semctl (int semid, int semnum, int cmd, ...)
{
union semun arg;
va_list ap;
va_end (ap);
+#ifdef __NR_semctl
+ return __semctl(semid, semnum, cmd, &arg);
+#else
return __ipc(IPCOP_semctl, semid, semnum, cmd, &arg);
+#endif
}
#endif
#ifdef L_semget
-#include <stdlib.h> /* for definition of NULL */
-/* Return identifier for array of NSEMS semaphores associated with
- KEY. */
-int
-semget (key, nsems, semflg)
- key_t key;
- int nsems;
- int semflg;
+/* for definition of NULL */
+#include <stdlib.h>
+
+#ifdef __NR_semget
+_syscall3(int, semget, key_t, key, int, nsems, int, semflg);
+
+#else
+/* Return identifier for array of NSEMS semaphores associated
+ * with KEY. */
+int semget (key_t key, int nsems, int semflg)
{
return __ipc(IPCOP_semget, key, nsems, semflg, NULL);
}
#endif
+#endif
#ifdef L_semop
+
+#ifdef __NR_semop
+_syscall3(int, semop, int, semid, struct sembuf *, sops, size_t, nsops);
+
+#else
/* Perform user-defined atomical operation of array of semaphores. */
-int
-semop (semid, sops, nsops)
- int semid;
- struct sembuf *sops;
- size_t nsops;
+int semop (int semid, struct sembuf *sops, size_t nsops)
{
return __ipc(IPCOP_semop, semid, (int) nsops, 0, sops);
}
#endif
+#endif
#ifdef L_shmctl
/* Provide operations to control over shared memory segments. */
-#ifdef __NR_shctl
-_syscall3(int, shmctl, int shmid, int, cmd, struct shmid_ds *, buf);
+#ifdef __NR_shmctl
+_syscall3(int, shmctl, int, shmid, int, cmd, struct shmid_ds *, buf);
#else
int shmctl (int shmid, int cmd, struct shmid_ds *buf)
{