diff options
Diffstat (limited to 'libc/misc/sysvipc')
| -rw-r--r-- | libc/misc/sysvipc/Makefile.in | 66 | ||||
| -rw-r--r-- | libc/misc/sysvipc/ftok.c | 4 | ||||
| -rw-r--r-- | libc/misc/sysvipc/ipc.h | 11 | ||||
| -rw-r--r-- | libc/misc/sysvipc/msgctl.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/msgget.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/msgq.c | 2 | ||||
| -rw-r--r-- | libc/misc/sysvipc/msgrcv.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/msgsnd.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/semctl.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/semget.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/semop.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/shm.c | 14 | ||||
| -rw-r--r-- | libc/misc/sysvipc/shmat.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/shmctl.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/shmdt.c | 8 | ||||
| -rw-r--r-- | libc/misc/sysvipc/shmget.c | 8 |
16 files changed, 123 insertions, 62 deletions
diff --git a/libc/misc/sysvipc/Makefile.in b/libc/misc/sysvipc/Makefile.in index 9a4446cb3..44707d643 100644 --- a/libc/misc/sysvipc/Makefile.in +++ b/libc/misc/sysvipc/Makefile.in @@ -1,69 +1,31 @@ # Makefile for uClibc # # Copyright (C) 2000 by Lineo, inc. -# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org> +# Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> # # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -MSRC1:=sem.c -MOBJ1:=semget.o semctl.o semop.o +CSRC := ftok.c -MSRC2:=shm.c -MOBJ2:=shmat.o shmctl.o shmdt.o shmget.o +# multi source sem.c +CSRC += semget.c semctl.c semop.c -MSRC3:=msgq.c -MOBJ3:=msgctl.o msgget.o msgrcv.o msgsnd.o +# multi source shm.c +CSRC += shmat.c shmctl.c shmdt.c shmget.c -CSRC:=ftok.c +# multi source msgq.c +CSRC += msgctl.c msgget.c msgrcv.c msgsnd.c -MISC_SYSVIPC_DIR:=$(top_srcdir)libc/misc/sysvipc -MISC_SYSVIPC_OUT:=$(top_builddir)libc/misc/sysvipc +MISC_SYSVIPC_DIR := $(top_srcdir)libc/misc/sysvipc +MISC_SYSVIPC_OUT := $(top_builddir)libc/misc/sysvipc -MISC_SYSVIPC_SRC:=$(patsubst %.c,$(MISC_SYSVIPC_DIR)/%.c,$(CSRC)) -MISC_SYSVIPC_OBJ:=$(patsubst %.c,$(MISC_SYSVIPC_OUT)/%.o,$(CSRC)) +MISC_SYSVIPC_SRC := $(patsubst %.c,$(MISC_SYSVIPC_DIR)/%.c,$(CSRC)) +MISC_SYSVIPC_OBJ := $(patsubst %.c,$(MISC_SYSVIPC_OUT)/%.o,$(CSRC)) -MISC_SYSVIPC_NO_MULTI:=$(MOBJ1) $(MOBJ3) +libc-y += $(MISC_SYSVIPC_OBJ) -MISC_SYSVIPC_MSRC1:=$(patsubst %.c,$(MISC_SYSVIPC_DIR)/%.c,$(MSRC1)) -MISC_SYSVIPC_MSRC2:=$(patsubst %.c,$(MISC_SYSVIPC_DIR)/%.c,$(MSRC2)) -MISC_SYSVIPC_MSRC3:=$(patsubst %.c,$(MISC_SYSVIPC_DIR)/%.c,$(MSRC3)) -MISC_SYSVIPC_MOBJ1:=$(patsubst %.o,$(MISC_SYSVIPC_OUT)/%.o,$(MOBJ1)) -MISC_SYSVIPC_MOBJ2:=$(patsubst %.o,$(MISC_SYSVIPC_OUT)/%.o,$(MOBJ2)) -MISC_SYSVIPC_MOBJ3:=$(patsubst %.o,$(MISC_SYSVIPC_OUT)/%.o,$(MOBJ3)) - -MISC_SYSVIPC_MSRC:=$(MISC_SYSVIPC_MSRC1) $(MISC_SYSVIPC_MSRC2) $(MISC_SYSVIPC_MSRC3) -MISC_SYSVIPC_MOBJ:=$(MISC_SYSVIPC_MOBJ1) $(MISC_SYSVIPC_MOBJ2) $(MISC_SYSVIPC_MOBJ3) - -MISC_SYSVIPC_DEF:=$(patsubst %,-DL_%,$(subst .o,,$(notdir $(MISC_SYSVIPC_MOBJ)))) - -MISC_SYSVIPC_OBJS:=$(MISC_SYSVIPC_OBJ) $(MISC_SYSVIPC_MOBJ) - -$(MISC_SYSVIPC_MOBJ1): $(MISC_SYSVIPC_MSRC1) - $(compile.m) - -$(MISC_SYSVIPC_MOBJ1:.o=.os): $(MISC_SYSVIPC_MSRC1) - $(compile.m) - -$(MISC_SYSVIPC_MOBJ2): $(MISC_SYSVIPC_MSRC2) - $(compile.m) - -$(MISC_SYSVIPC_MOBJ2:.o=.os): $(MISC_SYSVIPC_MSRC2) - $(compile.m) - -$(MISC_SYSVIPC_MOBJ3): $(MISC_SYSVIPC_MSRC3) - $(compile.m) - -$(MISC_SYSVIPC_MOBJ3:.o=.os): $(MISC_SYSVIPC_MSRC3) - $(compile.m) - -libc-a-y+=$(MISC_SYSVIPC_OBJS) -libc-so-y+=$(MISC_SYSVIPC_OBJS:.o=.os) - -CFLAGS-multi-y+=$(MISC_SYSVIPC_DEF) -libc-multi-y+=$(MISC_SYSVIPC_SRC) $(MISC_SYSVIPC_MSRC) - -objclean-y+=misc_sysvipc_objclean +objclean-y += misc_sysvipc_objclean misc_sysvipc_objclean: $(RM) $(MISC_SYSVIPC_OUT)/*.{o,os} diff --git a/libc/misc/sysvipc/ftok.c b/libc/misc/sysvipc/ftok.c index fd4021d3e..12627cad1 100644 --- a/libc/misc/sysvipc/ftok.c +++ b/libc/misc/sysvipc/ftok.c @@ -20,12 +20,14 @@ #include <sys/ipc.h> #include <sys/stat.h> +libc_hidden_proto(stat) + key_t ftok (const char *pathname, int proj_id) { struct stat st; key_t key; - if (__stat(pathname, &st) < 0) + if (stat(pathname, &st) < 0) return (key_t) -1; key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) diff --git a/libc/misc/sysvipc/ipc.h b/libc/misc/sysvipc/ipc.h index 105232fea..ffc07daf9 100644 --- a/libc/misc/sysvipc/ipc.h +++ b/libc/misc/sysvipc/ipc.h @@ -1,14 +1,19 @@ #ifndef IPC_H #define IPC_H #include <syscall.h> +#include <bits/wordsize.h> -#define __IPC_64 0x100 +#if __WORDSIZE == 32 +# define __IPC_64 0x100 +#else +# define __IPC_64 0x0 +#endif #ifdef __NR_ipc /* The actual system call: all functions are multiplexed by this. */ -extern int __syscall_ipc __P((unsigned int __call, int __first, int __second, - int __third, void *__ptr)) attribute_hidden; +extern int __syscall_ipc (unsigned int __call, int __first, int __second, + int __third, void *__ptr) attribute_hidden; /* The codes for the functions to use the multiplexer `__syscall_ipc'. */ diff --git a/libc/misc/sysvipc/msgctl.c b/libc/misc/sysvipc/msgctl.c new file mode 100644 index 000000000..480a54cbb --- /dev/null +++ b/libc/misc/sysvipc/msgctl.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_msgctl +#include "msgq.c" diff --git a/libc/misc/sysvipc/msgget.c b/libc/misc/sysvipc/msgget.c new file mode 100644 index 000000000..f7e54d5c8 --- /dev/null +++ b/libc/misc/sysvipc/msgget.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_msgget +#include "msgq.c" diff --git a/libc/misc/sysvipc/msgq.c b/libc/misc/sysvipc/msgq.c index 758dbaa47..f56bb4e8a 100644 --- a/libc/misc/sysvipc/msgq.c +++ b/libc/misc/sysvipc/msgq.c @@ -7,7 +7,7 @@ #ifdef __NR_msgctl #define __NR___libc_msgctl __NR_msgctl -_syscall3(int, __libc_msgctl, int, msqid, int, cmd, struct msqid_ds *, buf); +static inline _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) diff --git a/libc/misc/sysvipc/msgrcv.c b/libc/misc/sysvipc/msgrcv.c new file mode 100644 index 000000000..a85e52a99 --- /dev/null +++ b/libc/misc/sysvipc/msgrcv.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_msgrcv +#include "msgq.c" diff --git a/libc/misc/sysvipc/msgsnd.c b/libc/misc/sysvipc/msgsnd.c new file mode 100644 index 000000000..9f09d1fd4 --- /dev/null +++ b/libc/misc/sysvipc/msgsnd.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_msgsnd +#include "msgq.c" diff --git a/libc/misc/sysvipc/semctl.c b/libc/misc/sysvipc/semctl.c new file mode 100644 index 000000000..df62a76e3 --- /dev/null +++ b/libc/misc/sysvipc/semctl.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_semctl +#include "sem.c" diff --git a/libc/misc/sysvipc/semget.c b/libc/misc/sysvipc/semget.c new file mode 100644 index 000000000..94d0b5dad --- /dev/null +++ b/libc/misc/sysvipc/semget.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_semget +#include "sem.c" diff --git a/libc/misc/sysvipc/semop.c b/libc/misc/sysvipc/semop.c new file mode 100644 index 000000000..0c67f62f3 --- /dev/null +++ b/libc/misc/sysvipc/semop.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_semop +#include "sem.c" diff --git a/libc/misc/sysvipc/shm.c b/libc/misc/sysvipc/shm.c index 20e28d3b1..a466de921 100644 --- a/libc/misc/sysvipc/shm.c +++ b/libc/misc/sysvipc/shm.c @@ -17,8 +17,8 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* SHMLBA uses it */ -#define __getpagesize __getpagesize_internal +/* SHMLBA uses it on most of the archs (not mips) */ +#define __getpagesize getpagesize #include <stdlib.h> #include <errno.h> @@ -30,12 +30,16 @@ /* Attach the shared memory segment associated with SHMID to the data segment of the calling process. SHMADDR and SHMFLG determine how and where the segment is attached. */ -#if defined (__alpha__) -#define __NR_shmat __NR_osf_shmat +#if defined(__NR_osf_shmat) +# define __NR_shmat __NR_osf_shmat #endif #ifdef __NR_shmat _syscall3(void *, shmat, int, shmid, const void *,shmaddr, int, shmflg); #else +/* psm: don't remove this, else mips will fail */ +#include <unistd.h> +libc_hidden_proto(getpagesize) + void * shmat (int shmid, const void *shmaddr, int shmflg) { int retval; @@ -52,7 +56,7 @@ void * shmat (int shmid, const void *shmaddr, int shmflg) /* Provide operations to control over shared memory segments. */ #ifdef __NR_shmctl #define __NR___libc_shmctl __NR_shmctl -_syscall3(int, __libc_shmctl, int, shmid, int, cmd, struct shmid_ds *, buf); +static inline _syscall3(int, __libc_shmctl, int, shmid, int, cmd, struct shmid_ds *, buf); #endif int shmctl(int shmid, int cmd, struct shmid_ds *buf) { diff --git a/libc/misc/sysvipc/shmat.c b/libc/misc/sysvipc/shmat.c new file mode 100644 index 000000000..d6cd22a59 --- /dev/null +++ b/libc/misc/sysvipc/shmat.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_shmat +#include "shm.c" diff --git a/libc/misc/sysvipc/shmctl.c b/libc/misc/sysvipc/shmctl.c new file mode 100644 index 000000000..90fab5a25 --- /dev/null +++ b/libc/misc/sysvipc/shmctl.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_shmctl +#include "shm.c" diff --git a/libc/misc/sysvipc/shmdt.c b/libc/misc/sysvipc/shmdt.c new file mode 100644 index 000000000..078334136 --- /dev/null +++ b/libc/misc/sysvipc/shmdt.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_shmdt +#include "shm.c" diff --git a/libc/misc/sysvipc/shmget.c b/libc/misc/sysvipc/shmget.c new file mode 100644 index 000000000..4778e3619 --- /dev/null +++ b/libc/misc/sysvipc/shmget.c @@ -0,0 +1,8 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#define L_shmget +#include "shm.c" |
