summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-11-15 01:17:02 +0000
committerMike Frysinger <vapier@gentoo.org>2005-11-15 01:17:02 +0000
commitf6677b70e1e6379e09122ed1c705814173b83a53 (patch)
treefc42eb65c8a3d1e4f554a02694c5d45e3c2e8bb9
parent20e7f611558cc6237cc1deb8c2a0f42a3960e2a0 (diff)
update licenses and sync with glibc
-rw-r--r--libc/signal/killpg.c29
-rw-r--r--libc/signal/sigaction.c141
-rw-r--r--libc/signal/sigaddset.c31
-rw-r--r--libc/signal/sigandset.c30
-rw-r--r--libc/signal/sigblock.c4
-rw-r--r--libc/signal/sigdelset.c31
-rw-r--r--libc/signal/sigempty.c32
-rw-r--r--libc/signal/sigfillset.c41
-rw-r--r--libc/signal/siggetmask.c25
-rw-r--r--libc/signal/sighold.c42
-rw-r--r--libc/signal/sigignore.c37
-rw-r--r--libc/signal/sigintr.c53
-rw-r--r--libc/signal/sigisempty.c26
-rw-r--r--libc/signal/sigismem.c31
-rw-r--r--libc/signal/signal.c54
-rw-r--r--libc/signal/sigorset.c30
-rw-r--r--libc/signal/sigpause.c19
-rw-r--r--libc/signal/sigrelse.c42
-rw-r--r--libc/signal/sigset.c93
-rw-r--r--libc/signal/sigsetmask.c18
-rw-r--r--libc/signal/sigsetops.h17
-rw-r--r--libc/signal/sigwait.c36
-rw-r--r--libc/signal/sysv_signal.c52
23 files changed, 493 insertions, 421 deletions
diff --git a/libc/signal/killpg.c b/libc/signal/killpg.c
index e75cfc483..1fcf6bfa5 100644
--- a/libc/signal/killpg.c
+++ b/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);
}
diff --git a/libc/signal/sigaction.c b/libc/signal/sigaction.c
index eb6b43a49..0ead76ef6 100644
--- a/libc/signal/sigaction.c
+++ b/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)
diff --git a/libc/signal/sigaddset.c b/libc/signal/sigaddset.c
index 2e4f5c540..e5813c117 100644
--- a/libc/signal/sigaddset.c
+++ b/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);
}
diff --git a/libc/signal/sigandset.c b/libc/signal/sigandset.c
index a09e102ae..4e1abd969 100644
--- a/libc/signal/sigandset.c
+++ b/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);
}
diff --git a/libc/signal/sigblock.c b/libc/signal/sigblock.c
index 1d673f454..c02c234b6 100644
--- a/libc/signal/sigblock.c
+++ b/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)
diff --git a/libc/signal/sigdelset.c b/libc/signal/sigdelset.c
index 76279a945..16bc9ea4a 100644
--- a/libc/signal/sigdelset.c
+++ b/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);
}
diff --git a/libc/signal/sigempty.c b/libc/signal/sigempty.c
index 36b8f63fa..75b5be420 100644
--- a/libc/signal/sigempty.c
+++ b/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;
}
diff --git a/libc/signal/sigfillset.c b/libc/signal/sigfillset.c
index 6edbb0e6b..03361787e 100644
--- a/libc/signal/sigfillset.c
+++ b/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;
}
diff --git a/libc/signal/siggetmask.c b/libc/signal/siggetmask.c
index 0436532a5..f139d3861 100644
--- a/libc/signal/siggetmask.c
+++ b/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")
diff --git a/libc/signal/sighold.c b/libc/signal/sighold.c
index d30a337f2..670a4872e 100644
--- a/libc/signal/sighold.c
+++ b/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);
}
diff --git a/libc/signal/sigignore.c b/libc/signal/sigignore.c
index 64d1852ab..407b52e2a 100644
--- a/libc/signal/sigignore.c
+++ b/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);
}
diff --git a/libc/signal/sigintr.c b/libc/signal/sigintr.c
index e8cdd9814..8315c3a6b 100644
--- a/libc/signal/sigintr.c
+++ b/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
}
diff --git a/libc/signal/sigisempty.c b/libc/signal/sigisempty.c
index 9067ff08a..6d1de45a8 100644
--- a/libc/signal/sigisempty.c
+++ b/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