[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/build/uClibc/libc/misc/sysvipc/.indent.pro b/ap/build/uClibc/libc/misc/sysvipc/.indent.pro
new file mode 100644
index 0000000..492ecf1
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/.indent.pro
@@ -0,0 +1,33 @@
+--blank-lines-after-declarations
+--blank-lines-after-procedures
+--break-before-boolean-operator
+--no-blank-lines-after-commas
+--braces-on-if-line
+--braces-on-struct-decl-line
+--comment-indentation25
+--declaration-comment-column25
+--no-comment-delimiters-on-blank-lines
+--cuddle-else
+--continuation-indentation4
+--case-indentation0
+--else-endif-column33
+--space-after-cast
+--line-comments-indentation0
+--declaration-indentation1
+--dont-format-first-column-comments
+--dont-format-comments
+--honour-newlines
+--indent-level4
+/* changed from 0 to 4 */
+--parameter-indentation4
+--line-length78 /* changed from 75 */
+--continue-at-parentheses
+--no-space-after-function-call-names
+--dont-break-procedure-type
+--dont-star-comments
+--leave-optional-blank-lines
+--dont-space-special-semicolon
+--tab-size4
+/* additions by Mark */
+--case-brace-indentation0
+--leave-preprocessor-space
diff --git a/ap/build/uClibc/libc/misc/sysvipc/Makefile b/ap/build/uClibc/libc/misc/sysvipc/Makefile
new file mode 100644
index 0000000..4a8f4a0
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/Makefile
@@ -0,0 +1,13 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+top_srcdir=../../../
+top_builddir=../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.in
+include $(top_srcdir)Makerules
diff --git a/ap/build/uClibc/libc/misc/sysvipc/Makefile.in b/ap/build/uClibc/libc/misc/sysvipc/Makefile.in
new file mode 100644
index 0000000..115cfc6
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/Makefile.in
@@ -0,0 +1,32 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+subdirs += libc/misc/sysvipc
+
+CSRC := ftok.c __syscall_ipc.c
+
+# multi source sem.c
+CSRC += semget.c semctl.c semop.c semtimedop.c
+
+# multi source shm.c
+CSRC += shmat.c shmctl.c shmdt.c shmget.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_SRC := $(patsubst %.c,$(MISC_SYSVIPC_DIR)/%.c,$(CSRC))
+MISC_SYSVIPC_OBJ := $(patsubst %.c,$(MISC_SYSVIPC_OUT)/%.o,$(CSRC))
+
+libc-y += $(MISC_SYSVIPC_OBJ)
+
+objclean-y += CLEAN_libc/misc/sysvipc
+
+CLEAN_libc/misc/sysvipc:
+ $(do_rm) $(addprefix $(MISC_SYSVIPC_OUT)/*., o os)
diff --git a/ap/build/uClibc/libc/misc/sysvipc/__syscall_ipc.c b/ap/build/uClibc/libc/misc/sysvipc/__syscall_ipc.c
new file mode 100644
index 0000000..304a42c
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/__syscall_ipc.c
@@ -0,0 +1,17 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * __syscall_ipc() for uClibc
+ *
+ * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+
+#ifdef __NR_ipc
+#define __NR___syscall_ipc __NR_ipc
+#include "ipc.h"
+_syscall6(int, __syscall_ipc, unsigned int, call, long, first, long, second, long,
+ third, void *, ptr, void *, fifth)
+#endif
diff --git a/ap/build/uClibc/libc/misc/sysvipc/ftok.c b/ap/build/uClibc/libc/misc/sysvipc/ftok.c
new file mode 100644
index 0000000..cec2438
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/ftok.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <sys/ipc.h>
+#include <sys/stat.h>
+#ifdef __UCLIBC_HAS_LFS__
+# include <_lfs_64.h>
+#else
+# define stat64 stat
+#endif
+
+key_t ftok (const char *pathname, int proj_id)
+{
+ struct stat64 st;
+ key_t key;
+
+ if (stat64(pathname, &st) < 0)
+ return (key_t) -1;
+
+ key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
+ | ((proj_id & 0xff) << 24));
+
+ return key;
+}
diff --git a/ap/build/uClibc/libc/misc/sysvipc/ipc.h b/ap/build/uClibc/libc/misc/sysvipc/ipc.h
new file mode 100644
index 0000000..339d136
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/ipc.h
@@ -0,0 +1,35 @@
+#ifndef IPC_H
+#define IPC_H
+#include <syscall.h>
+#include <bits/wordsize.h>
+
+#if __WORDSIZE == 32 || defined __alpha__ || defined __mips__
+# 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 (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
+#define IPCOP_msgctl 14
+#define IPCOP_shmat 21
+#define IPCOP_shmdt 22
+#define IPCOP_shmget 23
+#define IPCOP_shmctl 24
+
+#endif
+
+#endif /* IPC_H */
diff --git a/ap/build/uClibc/libc/misc/sysvipc/msgctl.c b/ap/build/uClibc/libc/misc/sysvipc/msgctl.c
new file mode 100644
index 0000000..480a54c
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/msgget.c b/ap/build/uClibc/libc/misc/sysvipc/msgget.c
new file mode 100644
index 0000000..f7e54d5
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/msgq.c b/ap/build/uClibc/libc/misc/sysvipc/msgq.c
new file mode 100644
index 0000000..185cd26
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/msgq.c
@@ -0,0 +1,112 @@
+#include <errno.h>
+#include <sys/msg.h>
+#include "ipc.h"
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include "sysdep-cancel.h"
+#else
+#define SINGLE_THREAD_P 1
+#endif
+
+
+#ifdef L_msgctl
+
+#ifdef __NR_msgctl
+#define __NR___libc_msgctl __NR_msgctl
+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)
+{
+#ifdef __NR_msgctl
+ return __libc_msgctl(msqid, cmd | __IPC_64, buf);
+#else
+ return __syscall_ipc(IPCOP_msgctl, msqid, cmd | __IPC_64, 0, buf, 0);
+#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 __syscall_ipc(IPCOP_msgget ,key ,msgflg ,0 ,0, 0);
+}
+#endif
+#endif
+
+
+struct new_msg_buf{
+ struct msgbuf * oldmsg;
+ long int r_msgtyp; /* the fifth arg of __syscall_ipc */
+};
+/* Receive message from message queue. */
+
+
+#ifdef L_msgrcv
+#ifdef __NR_msgrcv
+#define __NR___syscall_msgrcv __NR_msgrcv
+static inline _syscall5(ssize_t, __syscall_msgrcv, int, msqid, void *, msgp,
+ size_t, msgsz, long int, msgtyp, int, msgflg)
+#endif
+static inline ssize_t do_msgrcv (int msqid, void *msgp, size_t msgsz,
+ long int msgtyp, int msgflg)
+{
+#ifdef __NR_msgrcv
+ return __syscall_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg);
+#else
+ struct new_msg_buf temp;
+
+ temp.r_msgtyp = msgtyp;
+ temp.oldmsg = msgp;
+ return __syscall_ipc(IPCOP_msgrcv ,msqid ,msgsz ,msgflg ,&temp, 0);
+#endif
+}
+ssize_t msgrcv (int msqid, void *msgp, size_t msgsz,
+ long int msgtyp, int msgflg)
+{
+ if (SINGLE_THREAD_P)
+ return do_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg);
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+ int oldtype = LIBC_CANCEL_ASYNC ();
+ int result = do_msgrcv(msqid, msgp, msgsz, msgtyp, msgflg);
+ LIBC_CANCEL_RESET (oldtype);
+ return result;
+#endif
+}
+#endif
+
+
+
+#ifdef L_msgsnd
+#ifdef __NR_msgsnd
+#define __NR___syscall_msgsnd __NR_msgsnd
+static inline _syscall4(int, __syscall_msgsnd, int, msqid, const void *, msgp,
+ size_t, msgsz, int, msgflg)
+#endif
+/* Send message to message queue. */
+static inline int do_msgsnd (int msqid, const void *msgp, size_t msgsz,
+ int msgflg)
+{
+#ifdef __NR_msgsnd
+ return __syscall_msgsnd(msqid, msgp, msgsz, msgflg);
+#else
+ return __syscall_ipc(IPCOP_msgsnd, msqid, msgsz, msgflg, (void *)msgp, 0);
+#endif
+}
+int msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
+{
+ if (SINGLE_THREAD_P)
+ return do_msgsnd(msqid, msgp, msgsz, msgflg);
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+ int oldtype = LIBC_CANCEL_ASYNC ();
+ int result = do_msgsnd(msqid, msgp, msgsz, msgflg);
+ LIBC_CANCEL_RESET (oldtype);
+ return result;
+#endif
+}
+#endif
+
diff --git a/ap/build/uClibc/libc/misc/sysvipc/msgrcv.c b/ap/build/uClibc/libc/misc/sysvipc/msgrcv.c
new file mode 100644
index 0000000..a85e52a
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/msgsnd.c b/ap/build/uClibc/libc/misc/sysvipc/msgsnd.c
new file mode 100644
index 0000000..9f09d1f
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/sem.c b/ap/build/uClibc/libc/misc/sysvipc/sem.c
new file mode 100644
index 0000000..cca4cdf
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/sem.c
@@ -0,0 +1,105 @@
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#include <errno.h>
+#include <sys/sem.h>
+#include <stddef.h>
+#include <stdlib.h> /* for NULL */
+
+#include "ipc.h"
+
+
+#ifdef L_semctl
+/* Return identifier for array of NSEMS semaphores associated with
+ KEY. */
+#include <stdarg.h>
+/* arg for semctl system calls. */
+union semun {
+ int val; /* value for SETVAL */
+ struct semid_ds *buf; /* buffer for IPC_STAT & IPC_SET */
+ unsigned short *array; /* array for GETALL & SETALL */
+ struct seminfo *__buf; /* buffer for IPC_INFO */
+ void *__pad;
+};
+
+
+#ifdef __NR_semctl
+#define __NR___semctl __NR_semctl
+static __inline__ _syscall4(int, __semctl, int, semid, int, semnum, int, cmd, void *, arg)
+#endif
+
+int semctl(int semid, int semnum, int cmd, ...)
+{
+ union semun arg;
+ va_list ap;
+
+ /* Get the argument. */
+ va_start (ap, cmd);
+ arg = va_arg (ap, union semun);
+ va_end (ap);
+#ifdef __NR_semctl
+ return __semctl(semid, semnum, cmd | __IPC_64, arg.__pad);
+#else
+ return __syscall_ipc(IPCOP_semctl, semid, semnum, cmd|__IPC_64, &arg, NULL);
+#endif
+}
+#endif
+
+#ifdef L_semget
+#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 __syscall_ipc(IPCOP_semget, key, nsems, semflg, NULL, 0);
+}
+#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 (int semid, struct sembuf *sops, size_t nsops)
+{
+ 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, (void *) timeout);
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/misc/sysvipc/semctl.c b/ap/build/uClibc/libc/misc/sysvipc/semctl.c
new file mode 100644
index 0000000..df62a76
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/semget.c b/ap/build/uClibc/libc/misc/sysvipc/semget.c
new file mode 100644
index 0000000..94d0b5d
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/semop.c b/ap/build/uClibc/libc/misc/sysvipc/semop.c
new file mode 100644
index 0000000..0c67f62
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/semtimedop.c b/ap/build/uClibc/libc/misc/sysvipc/semtimedop.c
new file mode 100644
index 0000000..ecd0438
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/semtimedop.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_semtimedop
+#include "sem.c"
diff --git a/ap/build/uClibc/libc/misc/sysvipc/shm.c b/ap/build/uClibc/libc/misc/sysvipc/shm.c
new file mode 100644
index 0000000..27e871f
--- /dev/null
+++ b/ap/build/uClibc/libc/misc/sysvipc/shm.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* SHMLBA uses it on most of the archs (not mips) */
+#define __getpagesize getpagesize
+
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/shm.h>
+#include <syscall.h>
+#include "ipc.h"
+
+#ifdef L_shmat
+/* 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(__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>
+
+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, 0);
+ return ((unsigned long int) retval > -(unsigned long int) SHMLBA
+ ? (void *) retval : (void *) raddr);
+}
+#endif
+#endif
+
+#ifdef L_shmctl
+/* Provide operations to control over shared memory segments. */
+#ifdef __NR_shmctl
+#define __NR___libc_shmctl __NR_shmctl
+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)
+{
+#ifdef __NR_shmctl
+ return __libc_shmctl(shmid, cmd | __IPC_64, buf);
+#else
+ return __syscall_ipc(IPCOP_shmctl, shmid, cmd | __IPC_64, 0, buf, 0);
+#endif
+}
+#endif
+
+
+#ifdef L_shmdt
+/* Detach shared memory segment starting at address specified by SHMADDR
+ from the caller's data segment. */
+#ifdef __NR_shmdt
+_syscall1(int, shmdt, const void *, shmaddr)
+#else
+int shmdt (const void *shmaddr)
+{
+ return __syscall_ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr, 0);
+}
+#endif
+#endif
+
+#ifdef L_shmget
+/* Return an identifier for an shared memory segment of at least size SIZE
+ which is associated with KEY. */
+#ifdef __NR_shmget
+_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, 0);
+}
+#endif
+#endif
diff --git a/ap/build/uClibc/libc/misc/sysvipc/shmat.c b/ap/build/uClibc/libc/misc/sysvipc/shmat.c
new file mode 100644
index 0000000..d6cd22a
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/shmctl.c b/ap/build/uClibc/libc/misc/sysvipc/shmctl.c
new file mode 100644
index 0000000..90fab5a
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/shmdt.c b/ap/build/uClibc/libc/misc/sysvipc/shmdt.c
new file mode 100644
index 0000000..0783341
--- /dev/null
+++ b/ap/build/uClibc/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/ap/build/uClibc/libc/misc/sysvipc/shmget.c b/ap/build/uClibc/libc/misc/sysvipc/shmget.c
new file mode 100644
index 0000000..4778e36
--- /dev/null
+++ b/ap/build/uClibc/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"