diff options
author | Eric Andersen <andersen@codepoet.org> | 2004-01-21 23:27:48 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2004-01-21 23:27:48 +0000 |
commit | 6334e558ab33ee1e54ed33740881a2798c5915c2 (patch) | |
tree | 5d3253d5928343d2a37cc55be7a9c35244b4ab42 /libc/misc | |
parent | 9bafaa6fe7ded400aac87526ce615f1875ce2673 (diff) |
Split up syscalls.c, since it had grown to be quite large and ugly.
-Erik
Diffstat (limited to 'libc/misc')
-rw-r--r-- | libc/misc/sysvipc/ftok.c | 5 | ||||
-rw-r--r-- | libc/misc/sysvipc/ipc.h | 2 | ||||
-rw-r--r-- | libc/misc/sysvipc/msgq.c | 10 | ||||
-rw-r--r-- | libc/misc/sysvipc/sem.c | 14 | ||||
-rw-r--r-- | libc/misc/sysvipc/shm.c | 8 |
5 files changed, 18 insertions, 21 deletions
diff --git a/libc/misc/sysvipc/ftok.c b/libc/misc/sysvipc/ftok.c index ce0bd3f40..2bd8b2ec0 100644 --- a/libc/misc/sysvipc/ftok.c +++ b/libc/misc/sysvipc/ftok.c @@ -20,10 +20,7 @@ #include <sys/ipc.h> #include <sys/stat.h> -key_t -ftok (pathname, proj_id) - const char *pathname; - int proj_id; +key_t ftok (const char *pathname, int proj_id) { struct stat st; key_t key; diff --git a/libc/misc/sysvipc/ipc.h b/libc/misc/sysvipc/ipc.h index 18011410f..741b720bc 100644 --- a/libc/misc/sysvipc/ipc.h +++ b/libc/misc/sysvipc/ipc.h @@ -5,7 +5,7 @@ #ifdef __NR_ipc /* The actual system call: all functions are multiplexed by this. */ -extern int __ipc __P((int __call, int __first, int __second, +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 ffd58df05..d4f48e7ad 100644 --- a/libc/misc/sysvipc/msgq.c +++ b/libc/misc/sysvipc/msgq.c @@ -11,7 +11,7 @@ _syscall3(int, msgctl, int, msqid, int, cmd, struct msqid_ds *, buf); /* Message queue control operation. */ int msgctl (int msqid, int cmd, struct msqid_ds *buf) { - return __ipc(IPCOP_msgctl ,msqid ,cmd ,0 ,buf); + return __syscall_ipc(IPCOP_msgctl ,msqid ,cmd ,0 ,buf); } #endif #endif @@ -24,7 +24,7 @@ _syscall2(int, msgget, key_t, key, int, msgflg) /* Get messages queue. */ int msgget (key_t key, int msgflg) { - return __ipc(IPCOP_msgget ,key ,msgflg ,0 ,0); + return __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0); } #endif #endif @@ -32,7 +32,7 @@ int msgget (key_t key, int msgflg) struct new_msg_buf{ struct msgbuf * oldmsg; - long int r_msgtyp; /* the fifth arg of __ipc */ + long int r_msgtyp; /* the fifth arg of __syscall_ipc */ }; /* Receive message from message queue. */ @@ -48,7 +48,7 @@ int msgrcv (int msqid, void *msgp, size_t msgsz, temp.r_msgtyp = msgtyp; temp.oldmsg = msgp; - return __ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp); + return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp); } #endif #endif @@ -62,7 +62,7 @@ _syscall4(int, msgsnd, int, msqid, const void *, msgp, size_t, msgsz, int, msgfl /* 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); + return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp); } #endif #endif diff --git a/libc/misc/sysvipc/sem.c b/libc/misc/sysvipc/sem.c index a3eaca7be..1cc39e7bd 100644 --- a/libc/misc/sysvipc/sem.c +++ b/libc/misc/sysvipc/sem.c @@ -44,7 +44,7 @@ static inline _syscall4(int, __semctl, int, semid, int, semnum, int, cmd, union int semctl(int semid, int semnum, int cmd, ...) { union semun arg; - va_list ap; + va_list ap; /* Get the argument. */ va_start (ap, cmd); @@ -53,24 +53,24 @@ int semctl(int semid, int semnum, int cmd, ...) #ifdef __NR_semctl return __semctl(semid, semnum, cmd, &arg); #else - return __ipc(IPCOP_semctl, semid, semnum, cmd, &arg); + return __syscall_ipc(IPCOP_semctl, semid, semnum, cmd, &arg); #endif -} +} #endif #ifdef L_semget /* for definition of NULL */ -#include <stdlib.h> +#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 +/* 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); + return __syscall_ipc(IPCOP_semget, key, nsems, semflg, NULL); } #endif #endif @@ -84,7 +84,7 @@ _syscall3(int, semop, int, semid, struct sembuf *, sops, size_t, nsops); /* Perform user-defined atomical operation of array of semaphores. */ int semop (int semid, struct sembuf *sops, size_t nsops) { - return __ipc(IPCOP_semop, semid, (int) nsops, 0, sops); + return __syscall_ipc(IPCOP_semop, semid, (int) nsops, 0, sops); } #endif #endif diff --git a/libc/misc/sysvipc/shm.c b/libc/misc/sysvipc/shm.c index 553c1203e..8193ac2f0 100644 --- a/libc/misc/sysvipc/shm.c +++ b/libc/misc/sysvipc/shm.c @@ -38,7 +38,7 @@ void * shmat (int shmid, const void *shmaddr, int shmflg) int retval; unsigned long raddr; - retval = __ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr); + retval = __syscall_ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr); return ((unsigned long int) retval > -(unsigned long int) SHMLBA ? (void *) retval : (void *) raddr); } @@ -52,7 +52,7 @@ _syscall3(int, shmctl, int, shmid, int, cmd, struct shmid_ds *, buf); #else int shmctl (int shmid, int cmd, struct shmid_ds *buf) { - return __ipc(IPCOP_shmctl, shmid, cmd, 0, buf); + return __syscall_ipc(IPCOP_shmctl, shmid, cmd, 0, buf); } #endif #endif @@ -66,7 +66,7 @@ _syscall1(int, shmdt, const void *, shmaddr); #else int shmdt (const void *shmaddr) { - return __ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr); + return __syscall_ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr); } #endif #endif @@ -79,7 +79,7 @@ _syscall3(int, shmget, key_t, key, size_t, size, int, shmflg); #else int shmget (key_t key, size_t size, int shmflg) { - return __ipc(IPCOP_shmget, key, size, shmflg, NULL); + return __syscall_ipc(IPCOP_shmget, key, size, shmflg, NULL); } #endif #endif |