[uClibc]SysV IPC support patch suggestion

michaels at jungo.com michaels at jungo.com
Thu Mar 1 12:43:44 UTC 2001


Hi,

I saw that part of sysv ipc is in our tree (shm), when the rest is out.
I needed semaphore support, so I just basically added the code that
calls __ipc syscall and rearranged the code into two .c files (I learned
from other uClibc places how to do it). One if for old shmxxx, another
one is for semxxx.  
So, I think we must remove misc/shm and replace it with misc/sysvipc.

Also, for utmp, some old sysv code uses ut_name which was made obsolete,
and replaced with ut_user. I used the Glibc's way to solve the problem.

Attached is the patch for the mentioned additions.
 
Anyone eager to have message calls too? I can do it as well.

Sincerely yours,
Michael Shmulevich
______________________________________
Software Developer
Jungo - R&D 
email: michaels at jungo.com
web: http://www.jungo.com
Phone: 1-877-514-0537(USA)  +972-9-8859365(Worldwide) ext. 233
Fax:   1-877-514-0538(USA)  +972-9-8859366(Worldwide)
-------------- next part --------------
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uuClibc.orig/sysdeps/linux/i386/bits/sem.h uClibc/sysdeps/linux/i386/bits/sem.h
--- uClibc.orig/sysdeps/linux/i386/bits/sem.h	Thu Jan  1 02:00:00 1970
+++ uClibc/sysdeps/linux/i386/bits/sem.h	Mon Jan  1 12:39:46 2001
@@ -0,0 +1,62 @@
+/* Copyright (C) 1995, 1996, 1997, 1998
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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.  */
+
+#ifndef _SYS_SEM_H
+# error "Never include <bits/sem.h> directly; use <sys/sem.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Flags for `semop'.  */
+#define SEM_UNDO	0x1000		/* undo the operation on exit */
+
+/* Commands for `semctl'.  */
+#define GETPID		11		/* get sempid */
+#define GETVAL		12		/* get semval */
+#define GETALL		13		/* get all semval's */
+#define GETNCNT		14		/* get semncnt */
+#define GETZCNT		15		/* get semzcnt */
+#define SETVAL		16		/* set semval */
+#define SETALL		17		/* set all semval's */
+
+
+/* Data structure describing a set of semaphores.  */
+struct semid_ds
+{
+  struct ipc_perm sem_perm;		/* operation permission struct */
+  __time_t sem_otime;			/* last semop() time */
+  __time_t sem_ctime;			/* last time changed by semctl() */
+  unsigned short int sem_nsems;		/* number of semaphores in set */
+};
+
+/* The user should define a union like the following to use it for arguments
+   for `semctl'.
+
+   union semun
+   {
+     int val;				<= value for SETVAL
+     struct semid_ds *buf;		<= buffer for IPC_STAT & IPC_SET
+     unsigned short int *array;		<= array for GETALL & SETALL
+     struct seminfo *__buf;		<= buffer for IPC_INFO
+   };
+
+   Previous versions of this file used to define this union but this is
+   incorrect.  One can test the macro _SEM_SEMUN_UNDEFINED to see whether
+   one must define the union or not.  */
+#define _SEM_SEMUN_UNDEFINED	1
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/include/sys/sem.h uClibc/include/sys/sem.h
--- uClibc.orig/include/sys/sem.h	Thu Jan  1 02:00:00 1970
+++ uClibc/include/sys/sem.h	Mon Jan  1 12:44:22 2001
@@ -0,0 +1,58 @@
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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.  */
+
+#ifndef _SYS_SEM_H
+#define _SYS_SEM_H	1
+
+#include <features.h>
+
+#include <sys/types.h>
+
+/* Get common definition of System V style IPC.  */
+#include <sys/ipc.h>
+
+/* Get system dependent definition of `struct semid_ds' and more.  */
+#include <bits/sem.h>
+
+/* The following System V style IPC functions implement a semaphore
+   handling.  The definition is found in XPG2.  */
+
+/* Structure used for argument to `semop' to describe operations.  */
+struct sembuf
+{
+  short int sem_num;		/* semaphore number */
+  short int sem_op;		/* semaphore operation */
+  short int sem_flg;		/* operation flag */
+};
+
+
+__BEGIN_DECLS
+
+/* Semaphore control operation.  */
+extern int semctl __P ((int __semid, int __semnum, int __cmd, ...));
+
+/* Get semaphore.  */
+extern int semget __P ((key_t __key, int __nsems, int __semflg));
+
+/* Operate on semaphore.  */
+extern int semop __P ((int __semid, struct sembuf *__sops,
+		       unsigned int __nsops));
+
+__END_DECLS
+
+#endif /* sys/sem.h */
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/include/utmp.h uClibc/include/utmp.h
--- uClibc.orig/include/utmp.h	Sun May 14 07:16:36 2000
+++ uClibc/include/utmp.h	Mon Feb 19 20:44:31 2001
@@ -30,6 +30,7 @@
   char    ut_line[UT_LINESIZE];    /* devicename of tty -"/dev/", null-term */
   char    ut_id[2];                /* abbrev. ttyname, as 01, s1 etc. */
   time_t  ut_time;                 /* login time */
+#define ut_name ut_user 		/* Backwards compatibility hack  */ 
   char    ut_user[UT_NAMESIZE];    /* username, not null-term */
   char    ut_host[UT_HOSTSIZE];    /* hostname for remote login... */
   long    ut_addr;                 /* IP addr of remote host */
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/Makefile uClibc/misc/Makefile
--- uClibc.orig/misc/Makefile	Thu Feb 15 18:17:15 2001
+++ uClibc/misc/Makefile	Thu Mar  1 12:43:34 2001
@@ -25,7 +25,7 @@
 LIBC=$(TOPDIR)libc.a
 
 
-DIRS = assert crypt ctype fnmatch glob internals lsearch mntent syslog shm time utmp tsearch
+DIRS = assert crypt ctype fnmatch glob internals lsearch mntent syslog time utmp tsearch sysvipc
 
 # regex bombs out with an internal compiler error using m68k-pic-coff-gcc.
 ifneq ($(TARGET_ARCH),m68k)
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/sysvipc/.indent.pro uClibc/misc/sysvipc/.indent.pro
--- uClibc.orig/misc/sysvipc/.indent.pro	Thu Jan  1 02:00:00 1970
+++ uClibc/misc/sysvipc/.indent.pro	Sun Oct  8 02:39:15 2000
@@ -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 -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/sysvipc/Makefile uClibc/misc/sysvipc/Makefile
--- uClibc.orig/misc/sysvipc/Makefile	Thu Jan  1 02:00:00 1970
+++ uClibc/misc/sysvipc/Makefile	Thu Mar  1 12:30:42 2001
@@ -0,0 +1,71 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000 by Lineo, inc.
+#
+# This program 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.
+#
+# This program 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 this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
+# other sundry sources.  Files within this library are copyright by their
+# respective copyright holders.
+
+TOPDIR=../../
+include $(TOPDIR)Rules.mak
+LIBC=$(TOPDIR)libc.a
+
+MSRC=sem.c
+MOBJ=semget.o semctl.o semop.o
+
+MSRC2=shm.c
+MOBJ2=shmat.o shmctl.o shmdt.o shmget.o
+
+CSRC = ftok.c 
+COBJS=$(patsubst %.c,%.o, $(CSRC))
+
+OBJS=$(MOBJ) $(MOBJ2) $(COBJS)
+
+
+all: $(OBJS) $(LIBC)
+
+$(LIBC): ar-target subdirs
+
+ar-target: $(OBJS)
+	$(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+
+$(MOBJ): $(MSRC)
+	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+	$(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(MOBJ2): $(MSRC2)
+	$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+	$(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(COBJS): %.o : %.c
+	$(CC) $(CFLAGS) -c $< -o $@
+	$(STRIPTOOL) -x -R .note -R .comment $*.o
+
+clean: subdirs_clean
+	rm -f *.[oa] *~ core
+
+subdirs: $(patsubst %, _dir_%, $(DIRS))
+subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
+
+$(patsubst %, _dir_%, $(DIRS)) : dummy
+	$(MAKE) -C $(patsubst _dir_%, %, $@)
+
+$(patsubst %, _dirclean_%, $(DIRS)) : dummy
+	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
+
+.PHONY: dummy
+
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/sysvipc/ftok.c uClibc/misc/sysvipc/ftok.c
--- uClibc.orig/misc/sysvipc/ftok.c	Thu Jan  1 02:00:00 1970
+++ uClibc/misc/sysvipc/ftok.c	Thu Mar  1 12:22:13 2001
@@ -0,0 +1,38 @@
+/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at 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>
+
+key_t
+ftok (pathname, proj_id)
+     const char *pathname;
+     int proj_id;
+{
+  struct stat st;
+  key_t key;
+
+  if (_xstat (_STAT_VER, pathname, &st) < 0)
+    return (key_t) -1;
+
+  key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
+	 | ((proj_id & 0xff) << 24));
+
+  return key;
+}
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/sysvipc/ipc.h uClibc/misc/sysvipc/ipc.h
--- uClibc.orig/misc/sysvipc/ipc.h	Thu Jan  1 02:00:00 1970
+++ uClibc/misc/sysvipc/ipc.h	Sun Oct  8 02:39:15 2000
@@ -0,0 +1,22 @@
+#ifndef IPC_H
+#define IPC_H
+
+/* The actual system call: all functions are multiplexed by this.  */
+extern int __ipc __P((int __call, int __first, int __second,
+					  int __third, void *__ptr));
+
+
+/* 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_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							/* IPC_H */
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/sysvipc/sem.c uClibc/misc/sysvipc/sem.c
--- uClibc.orig/misc/sysvipc/sem.c	Thu Jan  1 02:00:00 1970
+++ uClibc/misc/sysvipc/sem.c	Thu Mar  1 12:54:17 2001
@@ -0,0 +1,79 @@
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at 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 "ipc.h"
+
+#ifdef L_semctl
+/* Return identifier for array of NSEMS semaphores associated with
+   KEY.  */
+#include <stdarg.h>
+/* Define a `union semun' suitable for Linux here.  */
+union semun
+{
+    int val;			/* value for SETVAL */
+    struct semid_ds *buf;		/* buffer for IPC_STAT & IPC_SET */
+    unsigned short int *array;	/* array for GETALL & SETALL */
+    struct seminfo *__buf;	/* buffer for IPC_INFO */
+};
+
+
+int
+semctl (int semid, int semnum, int cmd, ...)
+{
+    union semun arg;
+    va_list ap;
+
+    va_start (ap, cmd);
+
+    /* Get the argument.  */
+    arg = va_arg (ap, union semun);
+
+    va_end (ap);
+
+    return __ipc(IPCOP_semctl, semid, semnum, cmd, &arg);
+}    
+#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;
+{
+    return __ipc(IPCOP_semget, key, nsems, semflg, NULL);
+}
+#endif
+
+#ifdef L_semop
+/* Perform user-defined atomical operation of array of semaphores.  */
+int
+semop (semid, sops, nsops)
+    int semid;
+    struct sembuf *sops;
+    unsigned int nsops;
+{
+    return __ipc(IPCOP_semop, semid, (int) nsops, 0, sops);
+}
+#endif
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/misc/sysvipc/shm.c uClibc/misc/sysvipc/shm.c
--- uClibc.orig/misc/sysvipc/shm.c	Thu Jan  1 02:00:00 1970
+++ uClibc/misc/sysvipc/shm.c	Thu Mar  1 12:55:05 2001
@@ -0,0 +1,82 @@
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper at 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/shm.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.  */
+
+void *
+shmat (shmid, shmaddr, shmflg)
+    int shmid;
+    const void *shmaddr;
+    int shmflg;
+{
+    int retval;
+    unsigned long raddr;
+
+    retval = __ipc(IPCOP_shmat, shmid, shmflg, (int) &raddr, (void *) shmaddr);
+    return ((unsigned long int) retval > -(unsigned long int) SHMLBA
+	    ? (void *) retval : (void *) raddr);
+}
+#endif
+
+#ifdef L_shmctl
+/* Provide operations to control over shared memory segments.  */
+
+int
+shmctl (shmid, cmd, buf)
+    int shmid;
+    int cmd;
+    struct shmid_ds *buf;
+{
+    return __ipc(IPCOP_shmctl, shmid, cmd, 0, buf);
+}
+#endif
+
+
+#ifdef L_shmdt
+/* Detach shared memory segment starting at address specified by SHMADDR
+   from the caller's data segment.  */
+
+int
+shmdt (shmaddr)
+    const void *shmaddr;
+{
+    return __ipc(IPCOP_shmdt, 0, 0, 0, (void *) shmaddr);
+}
+#endif
+
+#ifdef L_shmget
+/* Return an identifier for an shared memory segment of at least size SIZE
+   which is associated with KEY.  */
+
+int
+shmget (key, size, shmflg)
+    key_t key;
+    size_t size;
+    int shmflg;
+{
+    return __ipc(IPCOP_shmget, key, size, shmflg, NULL);
+}
+#endif
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/signal/Makefile uClibc/signal/Makefile
--- uClibc.orig/signal/Makefile	Thu Jan 11 13:42:12 2001
+++ uClibc/signal/Makefile	Mon Feb 19 20:49:46 2001
@@ -24,7 +24,7 @@
 include $(TOPDIR)Rules.mak
 LIBC=$(TOPDIR)libc.a
 
-CSRC=bsd_sig.c raise.c sigblock.c siggtmsk.c sigjmp.c signal.c \
+CSRC=bsd_sig.c raise.c sigblock.c siggtmsk.c sigjmp.c signal.c sigintr.c\
 	sigpause.c sigstmsk.c sigaddset.c sigdelset.c sigismem.c sigemptyset.c
 COBJS=$(patsubst %.c,%.o, $(CSRC))
 
diff -urN --exclude=asm --exclude=linux --exclude=bits --exclude=CVS uClibc.orig/signal/sigintr.c uClibc/signal/sigintr.c
--- uClibc.orig/signal/sigintr.c	Thu Jan  1 02:00:00 1970
+++ uClibc/signal/sigintr.c	Mon Feb 19 20:51:34 2001
@@ -0,0 +1,57 @@
+/* Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   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 <stddef.h>
+#include <signal.h>
+#include <errno.h>
+
+/* If INTERRUPT is nonzero, make signal SIG interrupt system calls
+   (causing them to fail with EINTR); if INTERRUPT is zero, make system
+   calls be restarted after signal SIG.  */
+int
+siginterrupt (sig, interrupt)
+     int sig;
+     int interrupt;
+{
+#ifdef	SA_RESTART
+  extern sigset_t _sigintr;	/* Defined in signal.c.  */
+  struct sigaction action;
+
+  if (sigaction (sig, (struct sigaction *) NULL, &action) < 0)
+    return -1;
+
+  if (interrupt)
+    {
+      sigaddset (&_sigintr, sig);
+      action.sa_flags &= ~SA_RESTART;
+    }
+  else
+    {
+      sigdelset (&_sigintr, sig);
+      action.sa_flags |= SA_RESTART;
+    }
+
+  if (sigaction (sig, &action, (struct sigaction *) NULL) < 0)
+    return -1;
+
+  return 0;
+#else
+  __set_errno (ENOSYS);
+  return -1;
+#endif
+}


More information about the uClibc mailing list