Browse Source

update licenses and sync with glibc

Mike Frysinger 19 years ago
parent
commit
f6677b70e1

+ 16 - 13
libc/signal/killpg.c

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>
@@ -23,13 +23,16 @@
 /* Send SIG to all processes in process group PGRP.
 /* Send SIG to all processes in process group PGRP.
    If PGRP is zero, send SIG to all processes in
    If PGRP is zero, send SIG to all processes in
    the current process's process group.  */
    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);
+      __set_errno (EINVAL);
-	return -1;
+      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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>
 #include <string.h>
 #include <string.h>
+
 #include <sys/syscall.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>
 #include <bits/kernel_sigaction.h>
 
 
+int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact);
 
 
 #if defined __NR_rt_sigaction
 #if defined __NR_rt_sigaction
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* 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.  */
    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;
+	int result;
-    struct kernel_sigaction kact, koact;
+	struct kernel_sigaction kact, koact;
-
+
-#ifdef SIGCANCEL
+	if (act) {
-    if (sig == SIGCANCEL) {
+		kact.k_sa_handler = act->sa_handler;
-	__set_errno (EINVAL);
+		memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kact.sa_mask));
-	return -1;
+		kact.sa_flags = act->sa_flags;
-    }
-#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;
 # ifdef HAVE_SA_RESTORER
 # ifdef HAVE_SA_RESTORER
-	kact.sa_restorer = act->sa_restorer;
+		kact.sa_restorer = act->sa_restorer;
 # endif
 # endif
-    }
+	}
-
+	
-    /* XXX The size argument hopefully will have to be changed to the
+	/* XXX The size argument hopefully will have to be changed to the
-       real size of the user-level sigset_t.  */
+	   real size of the user-level sigset_t.  */
-    result = __syscall_rt_sigaction(sig, act ? __ptrvalue (&kact) : NULL,
+	result = __syscall_rt_sigaction(sig,
-	    oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
+			       act ? __ptrvalue (&kact) : NULL,
-
+			       oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
-    if (oact && result >= 0) {
+
-	oact->sa_handler = koact.k_sa_handler;
+	if (oact && result >= 0) {
-	memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
+		oact->sa_handler = koact.k_sa_handler;
-	oact->sa_flags = koact.sa_flags;
+		memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (oact->sa_mask));
+		oact->sa_flags = koact.sa_flags;
 # ifdef HAVE_SA_RESTORER
 # ifdef HAVE_SA_RESTORER
-	oact->sa_restorer = koact.sa_restorer;
+		oact->sa_restorer = koact.sa_restorer;
 # endif
 # endif
-    }
+	}
-    return result;
-}
 
 
+	return result;
+}
 
 
 #else
 #else
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
 /* 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.  */
    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;
+	int result;
-    struct old_kernel_sigaction kact, koact;
+	struct old_kernel_sigaction kact, koact;
-
+
-#ifdef SIGCANCEL
+	if (act) {
-    if (sig == SIGCANCEL) {
+		kact.k_sa_handler = act->sa_handler;
-	__set_errno (EINVAL);
+		kact.sa_mask = act->sa_mask.__val[0];
-	return -1;
+		kact.sa_flags = act->sa_flags;
-    }
-#endif
-    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
 # ifdef HAVE_SA_RESTORER
-	kact.sa_restorer = act->sa_restorer;
+		kact.sa_restorer = act->sa_restorer;
 # endif
 # endif
-    }
+	}
-    result = __syscall_sigaction(sig, act ? __ptrvalue (&kact) : NULL,
+
-	    oact ? __ptrvalue (&koact) : NULL);
+	result = __syscall_sigaction(sig,
-
+			       act ? __ptrvalue (&kact) : NULL,
-    if (oact && result >= 0) {
+			       oact ? __ptrvalue (&koact) : NULL);
-	oact->sa_handler = koact.k_sa_handler;
+
-	oact->sa_mask.__val[0] = koact.sa_mask;
+	if (oact && result >= 0) {
-	oact->sa_flags = koact.sa_flags;
+		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
 # ifdef HAVE_SA_RESTORER
-	oact->sa_restorer = koact.sa_restorer;
+		oact->sa_restorer = koact.sa_restorer;
 # endif
 # endif
-    }
+	}
-    return result;
+
+	return result;
 }
 }
 
 
 #endif
 #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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include "sigsetops.h"
 #include "sigsetops.h"
 
 
 /* Add SIGNO to SET.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #define __USE_GNU
 #define __USE_GNU
@@ -23,13 +23,17 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 /* Combine sets LEFT and RIGHT by logical AND and place result in DEST.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      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.  */
    02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
-#define __USE_GNU
 #include <signal.h>
 #include <signal.h>
 
 
 /* Block signals in MASK, returning the old mask.  */
 /* Block signals in MASK, returning the old mask.  */
-int sigblock (int mask)
+int __sigblock (int mask)
 {
 {
     register unsigned int sig;
     register unsigned int sig;
     sigset_t set, oset;
     sigset_t set, oset;
@@ -53,3 +52,4 @@ int sigblock (int mask)
     return 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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include "sigsetops.h"
 #include "sigsetops.h"
 
 
 /* Add SIGNO to SET.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>
 #include <string.h>
 #include <string.h>
 
 
 /* Clear all signals from SET.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>
 #include <string.h>
 #include <string.h>
 
 
 /* Set all signals in SET.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
-#define __USE_GNU
 #include <signal.h>
 #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.
 /* 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.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #define __need_NULL
 #define __need_NULL
 #include <stddef.h>
 #include <stddef.h>
-#define __USE_GNU
+#define _GNU_SOURCE
 #include <signal.h>
 #include <signal.h>
 
 
-int sighold (int sig)
+int
+sighold (sig)
+     int sig;
 {
 {
-    sigset_t set;
+  sigset_t set;
 
 
-    /* Retrieve current signal set.  */
+  /* Retrieve current signal set.  */
-    if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+  if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
-	return -1;
+    return -1;
 
 
-    /* Add the specified signal.  */
+  /* Add the specified signal.  */
-    if (__sigaddset (&set, sig) < 0)
+  if (sigaddset (&set, sig) < 0)
-	return -1;
+    return -1;
 
 
-    /* Set the new mask.  */
+  /* Set the new mask.  */
-    return sigprocmask (SIG_SETMASK, &set, NULL);
+  return sigprocmask (SIG_SETMASK, &set, NULL);
 }
 }

+ 21 - 16
libc/signal/sigignore.c

@@ -1,36 +1,41 @@
 /* Set the disposition of SIG to SIG_IGN.
 /* 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.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
+#define _GNU_SOURCE
 #include <errno.h>
 #include <errno.h>
 #define __need_NULL
 #define __need_NULL
 #include <stddef.h>
 #include <stddef.h>
 #include <signal.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;
+  act.sa_handler = SIG_IGN;
-    if (__sigemptyset (&act.sa_mask) < 0)
+  if (__sigemptyset (&act.sa_mask) < 0)
-	return -1;
+    return -1;
-    act.sa_flags = 0;
+  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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <stddef.h>
 #include <stddef.h>
 #include <signal.h>
 #include <signal.h>
@@ -23,32 +23,35 @@
 /* If INTERRUPT is nonzero, make signal SIG interrupt system calls
 /* If INTERRUPT is nonzero, make signal SIG interrupt system calls
    (causing them to fail with EINTR); if INTERRUPT is zero, make system
    (causing them to fail with EINTR); if INTERRUPT is zero, make system
    calls be restarted after signal SIG.  */
    calls be restarted after signal SIG.  */
-int siginterrupt (int sig, int interrupt)
+int
+siginterrupt (sig, interrupt)
+     int sig;
+     int interrupt;
 {
 {
 #ifdef	SA_RESTART
 #ifdef	SA_RESTART
-    extern sigset_t _sigintr;	/* Defined in signal.c.  */
+  extern sigset_t _sigintr attribute_hidden;	/* Defined in signal.c.  */
-    struct sigaction action;
+  struct sigaction action;
 
 
-    if (sigaction (sig, (struct sigaction *) NULL, &action) < 0)
+  if (sigaction (sig, (struct sigaction *) NULL, &action) < 0)
-	return -1;
+    return -1;
 
 
-    if (interrupt)
+  if (interrupt)
     {
     {
-	__sigaddset (&_sigintr, sig);
+      __sigaddset (&_sigintr, sig);
-	action.sa_flags &= ~SA_RESTART;
+      action.sa_flags &= ~SA_RESTART;
     }
     }
-    else
+  else
     {
     {
-	__sigdelset (&_sigintr, sig);
+      __sigdelset (&_sigintr, sig);
-	action.sa_flags |= SA_RESTART;
+      action.sa_flags |= SA_RESTART;
     }
     }
 
 
-    if (sigaction (sig, &action, (struct sigaction *) NULL) < 0)
+  if (sigaction (sig, &action, (struct sigaction *) NULL) < 0)
-	return -1;
+    return -1;
 
 
-    return 0;
+  return 0;
 #else
 #else
-    __set_errno (ENOSYS);
+  __set_errno (ENOSYS);
-    return -1;
+  return -1;
 #endif
 #endif
 }
 }

+ 14 - 12
libc/signal/sigisempty.c

@@ -2,19 +2,19 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #define __USE_GNU
 #define __USE_GNU
@@ -23,12 +23,14 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 /* Test whether SET is empty.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      return -1;
     }
     }
 
 
     return __sigisemptyset (set);
     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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include "sigsetops.h"
 #include "sigsetops.h"
 
 
 /* Return 1 if SIGNO is in SET, 0 if not.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      return -1;
     }
     }
 
 
-    return __sigismember (set, signo);
+  return __sigismember (set, signo);
 }
 }

+ 29 - 25
libc/signal/signal.c

@@ -1,49 +1,53 @@
 /* BSD-like signal function.
 /* 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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.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,
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */
    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.  */
+  /* Check signal extents to protect __sigismember.  */
-    if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+  if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
     {
     {
-	__set_errno (EINVAL);
+      __set_errno (EINVAL);
-	return SIG_ERR;
+      return SIG_ERR;
     }
     }
 
 
-    act.sa_handler = handler;
+  act.sa_handler = handler;
-    if (__sigemptyset (&act.sa_mask) < 0
+  if (__sigemptyset (&act.sa_mask) < 0
-	    || __sigaddset (&act.sa_mask, sig) < 0)
+      || __sigaddset (&act.sa_mask, sig) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
-    act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
+  act.sa_flags = __sigismember (&_sigintr, sig) ? 0 : SA_RESTART;
-    if (sigaction (sig, &act, &oact) < 0)
+  if (sigaction (sig, &act, &oact) < 0)
-	return SIG_ERR;
+    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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #define __USE_GNU
 #define __USE_GNU
@@ -23,13 +23,17 @@
 #include <stddef.h>
 #include <stddef.h>
 
 
 /* Combine sets LEFT and RIGHT by logical OR and place result in DEST.  */
 /* 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);
+      __set_errno (EINVAL);
-	return -1;
+      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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>

+ 22 - 20
libc/signal/sigrelse.c

@@ -1,40 +1,42 @@
 /* Remove SIG from the calling process' signal mask.
 /* 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.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #define __need_NULL
 #define __need_NULL
 #include <stddef.h>
 #include <stddef.h>
-#define __USE_GNU
+#define _GNU_SOURCE
 #include <signal.h>
 #include <signal.h>
 
 
-int sigrelse (int sig)
+int
+sigrelse (sig)
+     int sig;
 {
 {
-    sigset_t set;
+  sigset_t set;
 
 
-    /* Retrieve current signal set.  */
+  /* Retrieve current signal set.  */
-    if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
+  if (sigprocmask (SIG_SETMASK, NULL, &set) < 0)
-	return -1;
+    return -1;
 
 
-    /* Remove the specified signal.  */
+  /* Remove the specified signal.  */
-    if (__sigdelset (&set, sig) < 0)
+  if (sigdelset (&set, sig) < 0)
-	return -1;
+    return -1;
 
 
-    /* Set the new mask.  */
+  /* Set the new mask.  */
-    return sigprocmask (SIG_SETMASK, &set, NULL);
+  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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #define __need_NULL
 #define __need_NULL
 #include <stddef.h>
 #include <stddef.h>
+#define __USE_XOPEN_EXTENDED
 #include <signal.h>
 #include <signal.h>
+#include <string.h>	/* For the real memset prototype.  */
 
 
 
 
 /* Set the disposition for SIG.  */
 /* 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;
+  struct sigaction act, oact;
-    sigset_t set;
+  sigset_t set;
 
 
 #ifdef SIG_HOLD
 #ifdef SIG_HOLD
-    /* Handle SIG_HOLD first.  */
+  /* Handle SIG_HOLD first.  */
-    if (disp == SIG_HOLD)
+  if (disp == SIG_HOLD)
     {
     {
-	/* Create an empty signal set.  */
+      /* Create an empty signal set.  */
-	if (__sigemptyset (&set) < 0)
+      if (__sigemptyset (&set) < 0)
-	    return SIG_ERR;
+	return SIG_ERR;
 
 
-	/* Add the specified signal.  */
+      /* Add the specified signal.  */
-	if (__sigaddset (&set, sig) < 0)
+      if (__sigaddset (&set, sig) < 0)
-	    return SIG_ERR;
+	return SIG_ERR;
 
 
-	/* Add the signal set to the current signal mask.  */
+      /* Add the signal set to the current signal mask.  */
-	if (sigprocmask (SIG_BLOCK, &set, NULL) < 0)
+      if (sigprocmask (SIG_BLOCK, &set, NULL) < 0)
-	    return SIG_ERR;
+	return SIG_ERR;
 
 
-	return SIG_HOLD;
+      return SIG_HOLD;
     }
     }
 #endif	/* SIG_HOLD */
 #endif	/* SIG_HOLD */
 
 
-    /* Check signal extents to protect __sigismember.  */
+  /* Check signal extents to protect __sigismember.  */
-    if (disp == SIG_ERR || sig < 1 || sig >= NSIG)
+  if (disp == SIG_ERR || sig < 1 || sig >= NSIG)
     {
     {
-	__set_errno (EINVAL);
+      __set_errno (EINVAL);
-	return SIG_ERR;
+      return SIG_ERR;
     }
     }
 
 
-    act.sa_handler = disp;
+  act.sa_handler = disp;
-    if (__sigemptyset (&act.sa_mask) < 0)
+  if (__sigemptyset (&act.sa_mask) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
-    act.sa_flags = 0;
+  act.sa_flags = 0;
-    if (sigaction (sig, &act, &oact) < 0)
+  if (sigaction (sig, &act, &oact) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
 
 
-    /* Create an empty signal set.  */
+  /* Create an empty signal set.  */
-    if (__sigemptyset (&set) < 0)
+  if (__sigemptyset (&set) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
 
 
-    /* Add the specified signal.  */
+  /* Add the specified signal.  */
-    if (__sigaddset (&set, sig) < 0)
+  if (__sigaddset (&set, sig) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
 
 
-    /* Remove the signal set from the current signal mask.  */
+  /* Remove the signal set from the current signal mask.  */
-    if (sigprocmask (SIG_UNBLOCK, &set, NULL) < 0)
+  if (sigprocmask (SIG_UNBLOCK, &set, NULL) < 0)
-	return SIG_ERR;
+    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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>

+ 8 - 9
libc/signal/sigsetops.h

@@ -2,24 +2,23 @@
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 /* Definitions relevant to functions that operate on `sigset_t's.  */
 /* Definitions relevant to functions that operate on `sigset_t's.  */
 
 
 #include <errno.h>
 #include <errno.h>
-#define __USE_GNU
 #include <signal.h>
 #include <signal.h>
 #include <string.h>
 #include <string.h>
 
 

+ 18 - 18
libc/signal/sigwait.c

@@ -3,20 +3,20 @@
  *
  *
  * Copyright (C) 2003 by Erik Andersen <andersen@uclibc.org>
  * Copyright (C) 2003 by Erik Andersen <andersen@uclibc.org>
  *
  *
- * This program is free software; you can redistribute it and/or modify it
+ * This program is free software; you can redistribute it and/or
- * under the terms of the GNU Library General Public License as published by
+ * modify it under the terms of the GNU Lesser General Public
- * the Free Software Foundation; either version 2 of the License, or (at your
+ * License as published by the Free Software Foundation; either
- * option) any later version.
+ * 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
+ * The GNU C Library is distributed in the hope that it will be useful,
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * for more details.
+ * Lesser General Public License for more details.
  *
  *
- * You should have received a copy of the GNU Library General Public License
+ * You should have received a copy of the GNU Lesser General Public
- * along with this program; if not, write to the Free Software Foundation,
+ * License along with the GNU C Library; if not, write to the Free
- * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- */
+ * 02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>
@@ -25,12 +25,12 @@
 #undef sigwait
 #undef sigwait
 int attribute_hidden __sigwait (const sigset_t *set, int *sig)
 int attribute_hidden __sigwait (const sigset_t *set, int *sig)
 {
 {
-    int ret = 1;
+	int ret = 1;
-    if ((ret = sigwaitinfo(set, NULL)) != -1) {
+	if ((ret = sigwaitinfo(set, NULL)) != -1) {
-	*sig = ret;
+		*sig = ret;
-	return 0;
+		return 0;
-    }
+	}
-    return 1;
+	return 1;
 }
 }
 
 
 /* psm: keep this weak, because the one in libpthread.so could overwrite it */
 /* 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.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    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
+   modify it under the terms of the GNU Lesser General Public
-   published by the Free Software Foundation; either version 2 of the
+   License as published by the Free Software Foundation; either
-   License, or (at your option) any later version.
+   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,
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    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
+   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   License along with the GNU C Library; if not, write to the Free
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   Boston, MA 02111-1307, USA.  */
+   02111-1307 USA.  */
 
 
 #include <errno.h>
 #include <errno.h>
 #include <signal.h>
 #include <signal.h>
+#include <string.h>	/* For the real memset prototype.  */
+
 
 
 /* Tolerate non-threads versions of Posix */
 /* Tolerate non-threads versions of Posix */
 #ifndef SA_ONESHOT
 #ifndef SA_ONESHOT
@@ -32,25 +34,29 @@
 
 
 /* Set the handler for the signal SIG to HANDLER,
 /* Set the handler for the signal SIG to HANDLER,
    returning the old handler, or SIG_ERR on error.  */
    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.  */
+  /* Check signal extents to protect __sigismember.  */
-    if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
+  if (handler == SIG_ERR || sig < 1 || sig >= NSIG)
     {
     {
-	__set_errno (EINVAL);
+      __set_errno (EINVAL);
-	return SIG_ERR;
+      return SIG_ERR;
     }
     }
 
 
-    act.sa_handler = handler;
+  act.sa_handler = handler;
-    if (__sigemptyset (&act.sa_mask) < 0)
+  if (__sigemptyset (&act.sa_mask) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
-    act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
+  act.sa_flags = SA_ONESHOT | SA_NOMASK | SA_INTERRUPT;
-    act.sa_flags &= ~SA_RESTART;
+  act.sa_flags &= ~SA_RESTART;
-    if (sigaction (sig, &act, &oact) < 0)
+  if (sigaction (sig, &act, &oact) < 0)
-	return SIG_ERR;
+    return SIG_ERR;
 
 
-    return oact.sa_handler;
+  return oact.sa_handler;
 }
 }
+
 weak_alias (__sysv_signal, sysv_signal)
 weak_alias (__sysv_signal, sysv_signal)