summaryrefslogtreecommitdiff
path: root/signal
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
committerUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
commitdf4ef2ab9c0899b2670067cd97e58f7eb2913e00 (patch)
tree4cb343b5ba9ccdc9c0b96144412567b6a4eda0ee /signal
parent6f9e7002f38ae778b3ff2f586a3e5766382228e9 (diff)
update from main archive 960105cvs/libc-970107cvs/libc-970106
Diffstat (limited to 'signal')
-rw-r--r--signal/Makefile4
-rw-r--r--signal/sigaddset.c26
-rw-r--r--signal/sigdelset.c26
-rw-r--r--signal/sigempty.c36
-rw-r--r--signal/sigfillset.c35
-rw-r--r--signal/siggetmask.c28
-rw-r--r--signal/sigismem.c26
-rw-r--r--signal/signal.h37
8 files changed, 117 insertions, 101 deletions
diff --git a/signal/Makefile b/signal/Makefile
index eac9576895..2d99437208 100644
--- a/signal/Makefile
+++ b/signal/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
@@ -30,7 +30,7 @@ routines := signal raise killpg \
sigstack sigaltstack sigintr \
sigsetops sigempty sigfillset sigaddset sigdelset sigismem \
sigreturn \
- siggetmask bsd_signal
+ siggetmask sysv_signal
tests := tst-signal
diff --git a/signal/sigaddset.c b/signal/sigaddset.c
index 69185edca6..055e45f6c9 100644
--- a/signal/sigaddset.c
+++ b/signal/sigaddset.c
@@ -1,20 +1,20 @@
/* Copyright (C) 1991, 1996 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
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "sigsetops.h"
diff --git a/signal/sigdelset.c b/signal/sigdelset.c
index 0b88a0977b..dc33550d55 100644
--- a/signal/sigdelset.c
+++ b/signal/sigdelset.c
@@ -1,20 +1,20 @@
/* Copyright (C) 1991, 1996 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
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "sigsetops.h"
diff --git a/signal/sigempty.c b/signal/sigempty.c
index 5e4bebb27c..9dde24d363 100644
--- a/signal/sigempty.c
+++ b/signal/sigempty.c
@@ -1,22 +1,24 @@
-/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include "sigsetops.h"
+#include <errno.h>
+#include <signal.h>
+#include <string.h>
/* Clear all signals from SET. */
int
@@ -29,5 +31,7 @@ sigemptyset (set)
return -1;
}
- return __sigemptyset (set);
+ memset (set, 0xff, sizeof (sigset_t));
+
+ return 0;
}
diff --git a/signal/sigfillset.c b/signal/sigfillset.c
index 6ea4707e63..04c80a55dc 100644
--- a/signal/sigfillset.c
+++ b/signal/sigfillset.c
@@ -1,22 +1,23 @@
-/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1996, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include "sigsetops.h"
+#include <errno.h>
+#include <signal.h>
/* Set all signals in SET. */
int
@@ -29,5 +30,7 @@ sigfillset (set)
return -1;
}
- return __sigfillset (set);
+ memset (set, 0xff, sizeof (sigset_t));
+
+ return 0;
}
diff --git a/signal/siggetmask.c b/signal/siggetmask.c
index 348fe9a0c3..95b69b7dc6 100644
--- a/signal/siggetmask.c
+++ b/signal/siggetmask.c
@@ -1,21 +1,21 @@
/* siggetmask -- useless alias for `sigblock (0)' for old Linux compatibility.
-Copyright (C) 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+ Copyright (C) 1996 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <signal.h>
diff --git a/signal/sigismem.c b/signal/sigismem.c
index d171517509..73d792a98c 100644
--- a/signal/sigismem.c
+++ b/signal/sigismem.c
@@ -1,20 +1,20 @@
/* Copyright (C) 1991, 1996 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
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include "sigsetops.h"
diff --git a/signal/signal.h b/signal/signal.h
index 66ab3dd09a..cd833e8783 100644
--- a/signal/signal.h
+++ b/signal/signal.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
@@ -47,20 +47,28 @@ typedef __sig_atomic_t sig_atomic_t;
/* Type of a signal handler. */
typedef void (*__sighandler_t) __P ((int));
-/* Set the handler for the signal SIG to HANDLER,
- returning the old handler, or SIG_ERR on error. */
+/* Set the handler for the signal SIG to HANDLER, returning the old
+ handler, or SIG_ERR on error.
+ By default `signal' has the BSD semantic. */
extern __sighandler_t signal __P ((int __sig, __sighandler_t __handler));
-#if defined __FAVOR_BSD || defined __USE_XOPEN
-/* The X/Open definition of `signal' conflicts with the BSD version.
- So they defined another function `bsd_signal'. We will use this
- implementation as the official `signal' function if the BSD
- interface is preferred. */
-extern __sighandler_t bsd_signal __P ((int __sig, __sighandler_t __handler));
+#if defined __USE_XOPEN && !defined __USE_GNU
+/* The X/Open definition of `signal' specifies the SVID semantic. Use
+ the additional function `sysv_signal' when X/Open compatibility is
+ requested. */
+extern __sighandler_t __sysv_signal __P ((int __sig,
+ __sighandler_t __handler));
+extern __sighandler_t sysv_signal __P ((int __sig, __sighandler_t __handler));
-#ifdef __FAVOR_BSD
-#define signal(sig, handler) bsd_signal ((sig), (handler))
+/* Make sure the used `signal' implementation is the SVID version. */
+#define signal(sig, handler) __sysv_signal ((sig), (handler))
#endif
+
+#ifdef __USE_XOPEN
+/* The X/Open definition of `signal' conflicts with the BSD version.
+ So they defined another function `bsd_signal'. */
+extern __sighandler_t __bsd_signal __P ((int __sig, __sighandler_t __handler));
+extern __sighandler_t bsd_signal __P ((int __sig, __sighandler_t __handler));
#endif
/* Send signal SIG to process number PID. If PID is zero,
@@ -103,13 +111,14 @@ extern int __sigsetmask __P ((int __mask));
/* The `sigpause' function has two different interfaces. The original
BSD definition defines the argument as a mask of the signal, while
the more modern interface in X/Open defines it as the signal
- number. We go with the more modern version unless the user
- explitcly selects the BSD version. */
+ number. We go with the BSD version unless the user explicitly
+ selects the X/Open version. */
extern int __sigpause __P ((int __sig_or_mask, int __is_sig));
-#if defined __USE_BSD && !defined __USE_XOPEN
+#if defined __USE_BSD || defined __USE_GNU
/* Set the mask of blocked signals to MASK,
wait for a signal to arrive, and then restore the mask. */
+extern int sigpause __P ((int __mask));
#define sigpause(mask) __sigpause ((mask), 0)
#else
#ifdef __USE_XOPEN