diff options
| author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-09 16:47:01 +0000 |
|---|---|---|
| committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-07-09 16:47:01 +0000 |
| commit | 62a21af8006ab04282fdc354c5b4dc765f56d058 (patch) | |
| tree | 568761d58289238aa14cced3f0010809d4d28c00 /libc/misc/sysvipc | |
| parent | ef250238dc1572caf859c2b64652f9cdfb0d9e42 (diff) | |
| download | uClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.bz2 uClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.xz | |
BIG BIG commit: all left files merged from trunk [rev 22714]. Currenntly NPTL sh4 port build and work fine. All committed to allow Khem Ray working on a working branch to integrate the ARM nptl port. MIPS nptl port not tested but should still building and working fine. There are some other part non yet merged with trunk (misc/internals and some headers file that need some more work). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/misc/sysvipc')
| -rw-r--r-- | libc/misc/sysvipc/ipc.h | 7 | ||||
| -rw-r--r-- | libc/misc/sysvipc/msgq.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/sem.c | 23 | ||||
| -rw-r--r-- | libc/misc/sysvipc/shm.c | 8 |
4 files changed, 32 insertions, 14 deletions
diff --git a/libc/misc/sysvipc/ipc.h b/libc/misc/sysvipc/ipc.h index 62c035b20..339d1364b 100644 --- a/libc/misc/sysvipc/ipc.h +++ b/libc/misc/sysvipc/ipc.h @@ -3,7 +3,7 @@ #include <syscall.h> #include <bits/wordsize.h> -#if __WORDSIZE == 32 || defined __alpha__ +#if __WORDSIZE == 32 || defined __alpha__ || defined __mips__ # define __IPC_64 0x100 #else # define __IPC_64 0x0 @@ -12,14 +12,15 @@ #ifdef __NR_ipc /* The actual system call: all functions are multiplexed by this. */ -extern int __syscall_ipc (unsigned int __call, int __first, int __second, - int __third, void *__ptr) attribute_hidden; +extern int __syscall_ipc (unsigned int __call, long __first, long __second, + long __third, void *__ptr, void *__fifth) attribute_hidden; /* The codes for the functions to use the multiplexer `__syscall_ipc'. */ #define IPCOP_semop 1 #define IPCOP_semget 2 #define IPCOP_semctl 3 +#define IPCOP_semtimedop 4 #define IPCOP_msgsnd 11 #define IPCOP_msgrcv 12 #define IPCOP_msgget 13 diff --git a/libc/misc/sysvipc/msgq.c b/libc/misc/sysvipc/msgq.c index 5f695084a..fc0279119 100644 --- a/libc/misc/sysvipc/msgq.c +++ b/libc/misc/sysvipc/msgq.c @@ -15,7 +15,7 @@ int msgctl(int msqid, int cmd, struct msqid_ds *buf) #ifdef __NR_msgctl return __libc_msgctl(msqid, cmd | __IPC_64, buf); #else - return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf); + return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf, 0); #endif } #endif @@ -28,7 +28,7 @@ _syscall2(int, msgget, key_t, key, int, msgflg) /* Get messages queue. */ int msgget (key_t key, int msgflg) { - return __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0); + return __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0, 0); } #endif #endif @@ -80,7 +80,7 @@ int msgrcv (int msqid, void *msgp, size_t msgsz, temp.r_msgtyp = msgtyp; temp.oldmsg = msgp; - return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp); + return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp, 0); } #endif #endif @@ -116,7 +116,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 __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp); + return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp, 0); } #endif #endif diff --git a/libc/misc/sysvipc/sem.c b/libc/misc/sysvipc/sem.c index ccbe25b46..07705c9d9 100644 --- a/libc/misc/sysvipc/sem.c +++ b/libc/misc/sysvipc/sem.c @@ -19,6 +19,7 @@ #include <errno.h> #include <sys/sem.h> +#include <stddef.h> #include "ipc.h" @@ -26,6 +27,7 @@ /* Return identifier for array of NSEMS semaphores associated with KEY. */ #include <stdarg.h> +#include <stdlib.h> /* arg for semctl system calls. */ union semun { int val; /* value for SETVAL */ @@ -53,7 +55,7 @@ int semctl(int semid, int semnum, int cmd, ...) #ifdef __NR_semctl return __semctl(semid, semnum, cmd | __IPC_64, arg.__pad); #else - return __syscall_ipc(IPCOP_semctl, semid, semnum, cmd | __IPC_64, &arg); + return __syscall_ipc(IPCOP_semctl, semid, semnum, cmd|__IPC_64, &arg, NULL); #endif } #endif @@ -70,7 +72,7 @@ _syscall3(int, semget, key_t, key, int, nsems, int, semflg); * with KEY. */ int semget (key_t key, int nsems, int semflg) { - return __syscall_ipc(IPCOP_semget, key, nsems, semflg, NULL); + return __syscall_ipc(IPCOP_semget, key, nsems, semflg, NULL, 0); } #endif #endif @@ -84,7 +86,22 @@ _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 __syscall_ipc(IPCOP_semop, semid, (int) nsops, 0, sops); + return __syscall_ipc(IPCOP_semop, semid, (int) nsops, 0, sops, NULL); +} +#endif +#endif + +#ifdef L_semtimedop + +#ifdef __NR_semtimedop +_syscall4(int, semtimedop, int, semid, struct sembuf *, sops, size_t, nsops, const struct timespec *, timeout); + +#else + +int semtimedop(int semid, struct sembuf *sops, size_t nsops, + const struct timespec *timeout) +{ + return __syscall_ipc(IPCOP_semtimedop, semid, nsops, 0, sops, timeout); } #endif #endif diff --git a/libc/misc/sysvipc/shm.c b/libc/misc/sysvipc/shm.c index a466de921..9f76a12ed 100644 --- a/libc/misc/sysvipc/shm.c +++ b/libc/misc/sysvipc/shm.c @@ -45,7 +45,7 @@ void * shmat (int shmid, const void *shmaddr, int shmflg) int retval; unsigned long raddr; - retval = __syscall_ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr); + retval = __syscall_ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr, 0); return ((unsigned long int) retval > -(unsigned long int) SHMLBA ? (void *) retval : (void *) raddr); } @@ -63,7 +63,7 @@ int shmctl(int shmid, int cmd, struct shmid_ds *buf) #ifdef __NR_shmctl return __libc_shmctl(shmid, cmd | __IPC_64, buf); #else - return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf); + return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf, 0); #endif } #endif @@ -77,7 +77,7 @@ _syscall1(int, shmdt, const void *, shmaddr); #else int shmdt (const void *shmaddr) { - return __syscall_ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr); + return __syscall_ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr, 0); } #endif #endif @@ -90,7 +90,7 @@ _syscall3(int, shmget, key_t, key, size_t, size, int, shmflg); #else int shmget (key_t key, size_t size, int shmflg) { - return __syscall_ipc(IPCOP_shmget, key, size, shmflg, NULL); + return __syscall_ipc(IPCOP_shmget, key, size, shmflg, NULL, 0); } #endif #endif |
