Browse Source

update licenses and sync with glibc

Mike Frysinger 18 years ago
parent
commit
f6677b70e1

+ 16 - 13
libc/signal/killpg.c

@@ -2,19 +2,19 @@
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
@@ -23,13 +23,16 @@
 /* Send SIG to all processes in process group PGRP.
    If PGRP is zero, send SIG to all processes in
    the current process's process group.  */
-int killpg ( __pid_t pgrp, int sig)
+int
+killpg (pgrp, sig)
+     __pid_t pgrp;
+     int sig;
 {
-    if (pgrp < 0)
+  if (pgrp < 0)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    return kill (- pgrp, sig);
+  return kill (- pgrp, sig);
 }

+ 74 - 67
libc/signal/sigaction.c

@@ -1,107 +1,114 @@
-/* Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,1999,2000,2002,2003 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
 #include <string.h>
+
 #include <sys/syscall.h>
+
+
+/* The difference here is that the sigaction structure used in the
+   kernel is not the same as we use in the libc.  Therefore we must
+   translate it here.  */
 #include <bits/kernel_sigaction.h>
 
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
 
 #if defined __NR_rt_sigaction
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
+int
+__libc_sigaction (sig, act, oact)
+     int sig;
+     const struct sigaction *act;
+     struct sigaction *oact;
 {
-    int result;
-    struct kernel_sigaction kact, koact;
-
-#ifdef SIGCANCEL
-    if (sig == SIGCANCEL) {
-	__set_errno (EINVAL);
-	return -1;
-    }
-#endif
-    if (act) {
-	kact.k_sa_handler = act->sa_handler;
-	memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
-	kact.sa_flags = act->sa_flags;
+	int result;
+	struct kernel_sigaction kact, koact;
+
+	if (act) {
+		kact.k_sa_handler = act->sa_handler;
+		memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
+		kact.sa_flags = act->sa_flags;
 # ifdef HAVE_SA_RESTORER
-	kact.sa_restorer = act->sa_restorer;
+		kact.sa_restorer = act->sa_restorer;
 # endif
-    }
-
-    /* XXX The size argument hopefully will have to be changed to the
-       real size of the user-level sigset_t.  */
-    result = __syscall_rt_sigaction(sig, act ? __ptrvalue (&kact) : NULL,
-	    oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
-
-    if (oact && result >= 0) {
-	oact->sa_handler = koact.k_sa_handler;
-	memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
-	oact->sa_flags = koact.sa_flags;
+	}
+	
+	/* XXX The size argument hopefully will have to be changed to the
+	   real size of the user-level sigset_t.  */
+	result = __syscall_rt_sigaction(sig,
+			       act ? __ptrvalue (&kact) : NULL,
+			       oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+
+	if (oact && result >= 0) {
+		oact->sa_handler = koact.k_sa_handler;
+		memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
+		oact->sa_flags = koact.sa_flags;
 # ifdef HAVE_SA_RESTORER
-	oact->sa_restorer = koact.sa_restorer;
+		oact->sa_restorer = koact.sa_restorer;
 # endif
-    }
-    return result;
-}
+	}
 
+	return result;
+}
 
 #else
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
    If OACT is not NULL, put the old action for SIG in *OACT.  */
-int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
+int
+__libc_sigaction (sig, act, oact)
+     int sig;
+     const struct sigaction *act;
+     struct sigaction *oact;
 {
-    int result;
-    struct old_kernel_sigaction kact, koact;
-
-#ifdef SIGCANCEL
-    if (sig == SIGCANCEL) {
-	__set_errno (EINVAL);
-	return -1;
-    }
-#endif
-    if (act) {
-	kact.k_sa_handler = act->sa_handler;
-	kact.sa_mask = act->sa_mask.__val[0];
-	kact.sa_flags = act->sa_flags;
+	int result;
+	struct old_kernel_sigaction kact, koact;
+
+	if (act) {
+		kact.k_sa_handler = act->sa_handler;
+		kact.sa_mask = act->sa_mask.__val[0];
+		kact.sa_flags = act->sa_flags;
 # ifdef HAVE_SA_RESTORER
-	kact.sa_restorer = act->sa_restorer;
+		kact.sa_restorer = act->sa_restorer;
 # endif
-    }
-    result = __syscall_sigaction(sig, act ? __ptrvalue (&kact) : NULL,
-	    oact ? __ptrvalue (&koact) : NULL);
-
-    if (oact && result >= 0) {
-	oact->sa_handler = koact.k_sa_handler;
-	oact->sa_mask.__val[0] = koact.sa_mask;
-	oact->sa_flags = koact.sa_flags;
+	}
+
+	result = __syscall_sigaction(sig,
+			       act ? __ptrvalue (&kact) : NULL,
+			       oact ? __ptrvalue (&koact) : NULL);
+
+	if (oact && result >= 0) {
+		oact->sa_handler = koact.k_sa_handler;
+		oact->sa_mask.__val[0] = koact.sa_mask;
+		oact->sa_flags = koact.sa_flags;
 # ifdef HAVE_SA_RESTORER
-	oact->sa_restorer = koact.sa_restorer;
+		oact->sa_restorer = koact.sa_restorer;
 # endif
-    }
-    return result;
+	}
+
+	return result;
 }
 
 #endif
 
-weak_alias(__libc_sigaction, sigaction)
-
+weak_alias (__libc_sigaction, __sigaction)
+weak_alias (__libc_sigaction, sigaction)

+ 17 - 14
libc/signal/sigaddset.c

@@ -1,31 +1,34 @@
-/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 2003 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include "sigsetops.h"
 
 /* Add SIGNO to SET.  */
-int sigaddset (sigset_t *set, int signo)
+int
+sigaddset (set, signo)
+     sigset_t *set;
+     int signo;
 {
-    if (set == NULL || signo <= 0 || signo >= NSIG)
+  if (set == NULL || signo <= 0 || signo >= NSIG)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    return __sigaddset (set, signo);
+  return __sigaddset (set, signo);
 }

+ 17 - 13
libc/signal/sigandset.c

@@ -2,19 +2,19 @@
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #define __USE_GNU
@@ -23,13 +23,17 @@
 #include <stddef.h>
 
 /* Combine sets LEFT and RIGHT by logical AND and place result in DEST.  */
-int sigandset (sigset_t *dest, const sigset_t *left, const sigset_t *right)
+int
+sigandset (dest, left, right)
+     sigset_t *dest;
+     const sigset_t *left;
+     const sigset_t *right;
 {
-    if (dest == NULL || left == NULL || right == NULL)
+  if (dest == NULL || left == NULL || right == NULL)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    return __sigandset (dest, left, right);
+  return __sigandset (dest, left, right);
 }

+ 2 - 2
libc/signal/sigblock.c

@@ -17,11 +17,10 @@
    02111-1307 USA.  */
 
 #include <errno.h>
-#define __USE_GNU
 #include <signal.h>
 
 /* Block signals in MASK, returning the old mask.  */
-int sigblock (int mask)
+int __sigblock (int mask)
 {
     register unsigned int sig;
     sigset_t set, oset;
@@ -53,3 +52,4 @@ int sigblock (int mask)
     return mask;
 }
 
+strong_alias (__sigblock, sigblock)

+ 17 - 14
libc/signal/sigdelset.c

@@ -1,31 +1,34 @@
-/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1996, 2003 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include "sigsetops.h"
 
 /* Add SIGNO to SET.  */
-int sigdelset (sigset_t *set, int signo)
+int
+sigdelset (set, signo)
+     sigset_t *set;
+     int signo;
 {
-    if (set == NULL || signo <= 0 || signo >= NSIG)
+  if (set == NULL || signo <= 0 || signo >= NSIG)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    return __sigdelset (set, signo);
+  return __sigdelset (set, signo);
 }

+ 17 - 15
libc/signal/sigempty.c

@@ -1,35 +1,37 @@
-/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991,96,97,2002 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
 #include <string.h>
 
 /* Clear all signals from SET.  */
-int sigemptyset (sigset_t *set)
+int
+sigemptyset (set)
+     sigset_t *set;
 {
-    if (set == NULL)
+  if (set == NULL)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    memset (set, 0, sizeof (sigset_t));
+  memset (set, 0, sizeof (sigset_t));
 
-    return 0;
+  return 0;
 }

+ 26 - 15
libc/signal/sigfillset.c

@@ -1,35 +1,46 @@
-/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991,96,97,2002,2003,2004 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
 #include <string.h>
 
 /* Set all signals in SET.  */
-int sigfillset (sigset_t *set)
+int
+sigfillset (set)
+     sigset_t *set;
 {
-    if (set == NULL)
+  if (set == NULL)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    memset (set, 0xff, sizeof (sigset_t));
+  memset (set, 0xff, sizeof (sigset_t));
 
-    return 0;
+  /* If the implementation uses a cancellation signal don't set the bit.  */
+#ifdef SIGCANCEL
+  __sigdelset (set, SIGCANCEL);
+#endif
+  /* Likewise for the signal to implement setxid.  */
+#ifdef SIGSETXID
+  __sigdelset (set, SIGSETXID);
+#endif
+
+  return 0;
 }

+ 14 - 11
libc/signal/siggetmask.c

@@ -3,25 +3,28 @@
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
-#define __USE_GNU
 #include <signal.h>
 
-int siggetmask (void)
+extern int __sigblock (int __mask);
+int
+siggetmask (void)
 {
-    return sigblock (0);
+  return __sigblock (0);
 }
 
+link_warning (siggetmask,
+	      "warning: `siggetmask' is obsolete; `sigprocmask' is best")

+ 22 - 20
libc/signal/sighold.c

@@ -1,40 +1,42 @@
 /* Add SIG to the calling process' signal mask.
-   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #define __need_NULL
 #include <stddef.h>
-#define __USE_GNU
+#define _GNU_SOURCE
 #include <signal.h>
 
-int sighold (int sig)
+int
+sighold (sig)
+     int sig;
 {
-    sigset_t set;
+  sigset_t set;
 
-    /* Retrieve current signal set.  */
-    if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
-	return -1;
+  /* Retrieve current signal set.  */
+  if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+    return -1;
 
-    /* Add the specified signal.  */
-    if (__sigaddset (&set, sig) < 0)
-	return -1;
+  /* Add the specified signal.  */
+  if (sigaddset (&set, sig) < 0)
+    return -1;
 
-    /* Set the new mask.  */
-    return sigprocmask (SIG_SETMASK, &set, NULL);
+  /* Set the new mask.  */
+  return sigprocmask (SIG_SETMASK, &set, NULL);
 }

+ 21 - 16
libc/signal/sigignore.c

@@ -1,36 +1,41 @@
 /* Set the disposition of SIG to SIG_IGN.
-   Copyright (C) 1998 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
+#define _GNU_SOURCE
 #include <errno.h>
 #define __need_NULL
 #include <stddef.h>
 #include <signal.h>
+#include <string.h>	/* For the real memset prototype.  */
 
-int sigignore (int sig)
+
+int
+sigignore (sig)
+     int sig;
 {
-    struct sigaction act;
+  struct sigaction act;
 
-    act.sa_handler = SIG_IGN;
-    if (__sigemptyset (&act.sa_mask) < 0)
-	return -1;
-    act.sa_flags = 0;
+  act.sa_handler = SIG_IGN;
+  if (__sigemptyset (&act.sa_mask) < 0)
+    return -1;
+  act.sa_flags = 0;
 
-    return sigaction (sig, &act, NULL);
+  return sigaction (sig, &act, NULL);
 }

+ 28 - 25
libc/signal/sigintr.c

@@ -1,20 +1,20 @@
-/* Copyright (C) 1992, 1994, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1994, 1996, 2002 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; 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>
@@ -23,32 +23,35 @@
 /* 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 (int sig, int interrupt)
+int
+siginterrupt (sig, interrupt)
+     int sig;
+     int interrupt;
 {
 #ifdef	SA_RESTART
-    extern sigset_t _sigintr;	/* Defined in signal.c.  */
-    struct sigaction action;
+  extern sigset_t _sigintr attribute_hidden;	/* Defined in signal.c.  */
+  struct sigaction action;
 
-    if (sigaction (sig, (struct sigaction *) NULL, &action) < 0)
-	return -1;
+  if (sigaction (sig, (struct sigaction *) NULL, &action) < 0)
+    return -1;
 
-    if (interrupt)
+  if (interrupt)
     {
-	__sigaddset (&_sigintr, sig);
-	action.sa_flags &= ~SA_RESTART;
+      __sigaddset (&_sigintr, sig);
+      action.sa_flags &= ~SA_RESTART;
     }
-    else
+  else
     {
-	__sigdelset (&_sigintr, sig);
-	action.sa_flags |= SA_RESTART;
+      __sigdelset (&_sigintr, sig);
+      action.sa_flags |= SA_RESTART;
     }
 
-    if (sigaction (sig, &action, (struct sigaction *) NULL) < 0)
-	return -1;
+  if (sigaction (sig, &action, (struct sigaction *) NULL) < 0)
+    return -1;
 
-    return 0;
+  return 0;
 #else
-    __set_errno (ENOSYS);
-    return -1;
+  __set_errno (ENOSYS);
+  return -1;
 #endif
 }

+ 14 - 12
libc/signal/sigisempty.c

@@ -2,19 +2,19 @@
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #define __USE_GNU
@@ -23,12 +23,14 @@
 #include <stddef.h>
 
 /* Test whether SET is empty.  */
-int sigisemptyset (const sigset_t *set)
+int
+sigisemptyset (set)
+     const sigset_t *set;
 {
-    if (set == NULL)
+  if (set == NULL)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
     return __sigisemptyset (set);

+ 17 - 14
libc/signal/sigismem.c

@@ -1,31 +1,34 @@
-/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991,96,2002 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include "sigsetops.h"
 
 /* Return 1 if SIGNO is in SET, 0 if not.  */
-int sigismember (const sigset_t *set, int signo)
+int
+sigismember (set, signo)
+     const sigset_t *set;
+     int signo;
 {
-    if (set == NULL || signo <= 0 || signo >= NSIG)
+  if (set == NULL || signo <= 0 || signo >= NSIG)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    return __sigismember (set, signo);
+  return __sigismember (set, signo);
 }

+ 29 - 25
libc/signal/signal.c

@@ -1,49 +1,53 @@
 /* BSD-like signal function.
-   Copyright (C) 1991, 1992, 1996, 1997, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1991,1992,1996,1997,2000,2002,2005
+   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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>	/* For the real memset prototype.  */
 
 
-sigset_t _sigintr;		/* Set by siginterrupt.  */
+sigset_t _sigintr attribute_hidden;		/* Set by siginterrupt.  */
 
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */
-__sighandler_t bsd_signal (int sig, __sighandler_t handler)
+__sighandler_t
+__bsd_signal (int sig, __sighandler_t handler)
 {
-    struct sigaction act, oact;
+  struct sigaction act, oact;
 
-    /* Check signal extents to protect __sigismember.  */
-    if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+  /* Check signal extents to protect __sigismember.  */
+  if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
     {
-	__set_errno (EINVAL);
-	return SIG_ERR;
+      __set_errno (EINVAL);
+      return SIG_ERR;
     }
 
-    act.sa_handler = handler;
-    if (__sigemptyset (&act.sa_mask) < 0
-	    || __sigaddset (&act.sa_mask, sig) < 0)
-	return SIG_ERR;
-    act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
-    if (sigaction (sig, &act, &oact) < 0)
-	return SIG_ERR;
+  act.sa_handler = handler;
+  if (__sigemptyset (&act.sa_mask) < 0
+      || __sigaddset (&act.sa_mask, sig) < 0)
+    return SIG_ERR;
+  act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
+  if (sigaction (sig, &act, &oact) < 0)
+    return SIG_ERR;
 
-    return oact.sa_handler;
+  return oact.sa_handler;
 }
-weak_alias (bsd_signal, signal)
+weak_alias (__bsd_signal, bsd_signal)
+weak_alias (__bsd_signal, signal)

+ 17 - 13
libc/signal/sigorset.c

@@ -2,19 +2,19 @@
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #define __USE_GNU
@@ -23,13 +23,17 @@
 #include <stddef.h>
 
 /* Combine sets LEFT and RIGHT by logical OR and place result in DEST.  */
-int sigorset (sigset_t *dest, const sigset_t *left, const sigset_t *right)
+int
+sigorset (dest, left, right)
+     sigset_t *dest;
+     const sigset_t *left;
+     const sigset_t *right;
 {
-    if (dest == NULL || left == NULL || right == NULL)
+  if (dest == NULL || left == NULL || right == NULL)
     {
-	__set_errno (EINVAL);
-	return -1;
+      __set_errno (EINVAL);
+      return -1;
     }
 
-    return __sigorset (dest, left, right);
+  return __sigorset (dest, left, right);
 }

+ 10 - 9
libc/signal/sigpause.c

@@ -1,20 +1,21 @@
-/* Copyright (C) 1991, 92, 1994-1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,94-98,2000,2002,2003,2004
+   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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>

+ 22 - 20
libc/signal/sigrelse.c

@@ -1,40 +1,42 @@
 /* Remove SIG from the calling process' signal mask.
-   Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #define __need_NULL
 #include <stddef.h>
-#define __USE_GNU
+#define _GNU_SOURCE
 #include <signal.h>
 
-int sigrelse (int sig)
+int
+sigrelse (sig)
+     int sig;
 {
-    sigset_t set;
+  sigset_t set;
 
-    /* Retrieve current signal set.  */
-    if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
-	return -1;
+  /* Retrieve current signal set.  */
+  if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+    return -1;
 
-    /* Remove the specified signal.  */
-    if (__sigdelset (&set, sig) < 0)
-	return -1;
+  /* Remove the specified signal.  */
+  if (sigdelset (&set, sig) < 0)
+    return -1;
 
-    /* Set the new mask.  */
-    return sigprocmask (SIG_SETMASK, &set, NULL);
+  /* Set the new mask.  */
+  return sigprocmask (SIG_SETMASK, &set, NULL);
 }

+ 49 - 44
libc/signal/sigset.c

@@ -1,78 +1,83 @@
-/* Copyright (C) 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2000, 2005 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #define __need_NULL
 #include <stddef.h>
+#define __USE_XOPEN_EXTENDED
 #include <signal.h>
+#include <string.h>	/* For the real memset prototype.  */
 
 
 /* Set the disposition for SIG.  */
-__sighandler_t sigset (int sig, __sighandler_t disp)
+__sighandler_t
+sigset (sig, disp)
+     int sig;
+     __sighandler_t disp;
 {
-    struct sigaction act, oact;
-    sigset_t set;
+  struct sigaction act, oact;
+  sigset_t set;
 
 #ifdef SIG_HOLD
-    /* Handle SIG_HOLD first.  */
-    if (disp == SIG_HOLD)
+  /* Handle SIG_HOLD first.  */
+  if (disp == SIG_HOLD)
     {
-	/* Create an empty signal set.  */
-	if (__sigemptyset (&set) < 0)
-	    return SIG_ERR;
+      /* Create an empty signal set.  */
+      if (__sigemptyset (&set) < 0)
+	return SIG_ERR;
 
-	/* Add the specified signal.  */
-	if (__sigaddset (&set, sig) < 0)
-	    return SIG_ERR;
+      /* Add the specified signal.  */
+      if (__sigaddset (&set, sig) < 0)
+	return SIG_ERR;
 
-	/* Add the signal set to the current signal mask.  */
-	if (sigprocmask (SIG_BLOCK, &set, NULL) < 0)
-	    return SIG_ERR;
+      /* Add the signal set to the current signal mask.  */
+      if (sigprocmask (SIG_BLOCK, &set, NULL) < 0)
+	return SIG_ERR;
 
-	return SIG_HOLD;
+      return SIG_HOLD;
     }
 #endif	/* SIG_HOLD */
 
-    /* Check signal extents to protect __sigismember.  */
-    if (disp == SIG_ERR || sig < 1 || sig >= NSIG)
+  /* Check signal extents to protect __sigismember.  */
+  if (disp == SIG_ERR || sig < 1 || sig >= NSIG)
     {
-	__set_errno (EINVAL);
-	return SIG_ERR;
+      __set_errno (EINVAL);
+      return SIG_ERR;
     }
 
-    act.sa_handler = disp;
-    if (__sigemptyset (&act.sa_mask) < 0)
-	return SIG_ERR;
-    act.sa_flags = 0;
-    if (sigaction (sig, &act, &oact) < 0)
-	return SIG_ERR;
+  act.sa_handler = disp;
+  if (__sigemptyset (&act.sa_mask) < 0)
+    return SIG_ERR;
+  act.sa_flags = 0;
+  if (sigaction (sig, &act, &oact) < 0)
+    return SIG_ERR;
 
-    /* Create an empty signal set.  */
-    if (__sigemptyset (&set) < 0)
-	return SIG_ERR;
+  /* Create an empty signal set.  */
+  if (__sigemptyset (&set) < 0)
+    return SIG_ERR;
 
-    /* Add the specified signal.  */
-    if (__sigaddset (&set, sig) < 0)
-	return SIG_ERR;
+  /* Add the specified signal.  */
+  if (__sigaddset (&set, sig) < 0)
+    return SIG_ERR;
 
-    /* Remove the signal set from the current signal mask.  */
-    if (sigprocmask (SIG_UNBLOCK, &set, NULL) < 0)
-	return SIG_ERR;
+  /* Remove the signal set from the current signal mask.  */
+  if (sigprocmask (SIG_UNBLOCK, &set, NULL) < 0)
+    return SIG_ERR;
 
-    return oact.sa_handler;
+  return oact.sa_handler;
 }

+ 9 - 9
libc/signal/sigsetmask.c

@@ -1,20 +1,20 @@
-/* Copyright (C) 1991,1994,1995,1996,1997,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1994-1997,2001-2002 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>

+ 8 - 9
libc/signal/sigsetops.h

@@ -2,24 +2,23 @@
    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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /* Definitions relevant to functions that operate on `sigset_t's.  */
 
 #include <errno.h>
-#define __USE_GNU
 #include <signal.h>
 #include <string.h>
 

+ 18 - 18
libc/signal/sigwait.c

@@ -3,20 +3,20 @@
  *
  * Copyright (C) 2003 by Erik Andersen <andersen@uclibc.org>
  *
- * 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 free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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.
+ * 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
+ * Lesser 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
- */
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the GNU C Library; if not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ * 02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
@@ -25,12 +25,12 @@
 #undef sigwait
 int attribute_hidden __sigwait (const sigset_t *set, int *sig)
 {
-    int ret = 1;
-    if ((ret = sigwaitinfo(set, NULL)) != -1) {
-	*sig = ret;
-	return 0;
-    }
-    return 1;
+	int ret = 1;
+	if ((ret = sigwaitinfo(set, NULL)) != -1) {
+		*sig = ret;
+		return 0;
+	}
+	return 1;
 }
 
 /* psm: keep this weak, because the one in libpthread.so could overwrite it */

+ 29 - 23
libc/signal/sysv_signal.c

@@ -1,23 +1,25 @@
-/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1996, 1997, 2005 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.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 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.
+   Lesser 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.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 #include <errno.h>
 #include <signal.h>
+#include <string.h>	/* For the real memset prototype.  */
+
 
 /* Tolerate non-threads versions of Posix */
 #ifndef SA_ONESHOT
@@ -32,25 +34,29 @@
 
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */
-__sighandler_t __sysv_signal (int sig, __sighandler_t handler)
+__sighandler_t
+__sysv_signal (sig, handler)
+     int sig;
+     __sighandler_t handler;
 {
-    struct sigaction act, oact;
+  struct sigaction act, oact;
 
-    /* Check signal extents to protect __sigismember.  */
-    if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+  /* Check signal extents to protect __sigismember.  */
+  if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
     {
-	__set_errno (EINVAL);
-	return SIG_ERR;
+      __set_errno (EINVAL);
+      return SIG_ERR;
     }
 
-    act.sa_handler = handler;
-    if (__sigemptyset (&act.sa_mask) < 0)
-	return SIG_ERR;
-    act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
-    act.sa_flags &= ~SA_RESTART;
-    if (sigaction (sig, &act, &oact) < 0)
-	return SIG_ERR;
+  act.sa_handler = handler;
+  if (__sigemptyset (&act.sa_mask) < 0)
+    return SIG_ERR;
+  act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
+  act.sa_flags &= ~SA_RESTART;
+  if (sigaction (sig, &act, &oact) < 0)
+    return SIG_ERR;
 
-    return oact.sa_handler;
+  return oact.sa_handler;
 }
+
 weak_alias (__sysv_signal, sysv_signal)