about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog16
-rw-r--r--bits/sigaction.h21
-rw-r--r--sysdeps/generic/bits/sigaction.h21
3 files changed, 54 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 290599641d..59d15c1594 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2001-07-22  Roland McGrath  <roland@frob.com>
+
+	* hurd/hurdsig.c (_hurd_internal_post_signal): Support SA_RESETHAND
+	and SA_NODEFER options.  Spurred to action by Igor Khavkine.
+
+	* sysdeps/generic/bits/sigaction.h [__USE_UNIX98 || __USE_MISC]
+	(SA_NODEFER, SA_RESETHAND): New macros, same bit values as FreeBSD.
+	[__USE_MISC] (SA_INTERRUPT): New macro, value 0.
+	[__USE_MISC] (SA_NOMASK, SA_ONESHOT, SA_STACK): New macros, aliases
+	as in other sysdeps versions of this file.
+
+        * sysdeps/generic/bits/sigaction.h (struct sigaction): Use a union
+	and provide sa_handler and sa_sigaction member names as macros, as
+	done in other sysdeps versions of this file.
+	Suggested by Igor Khavkine <i_khavki@alcor.concordia.ca>.
+
 2001-07-23  Ulrich Drepper  <drepper@redhat.com>
 
 	* posix/regex.c: Revamp memory allocation for WCHAR functions to
diff --git a/bits/sigaction.h b/bits/sigaction.h
index 67981e8a2b..e23a96cd9d 100644
--- a/bits/sigaction.h
+++ b/bits/sigaction.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,96,97,98,2001 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,12 @@
 struct sigaction
   {
     /* Signal handler.  */
-    __sighandler_t sa_handler;
+    union {
+      __sighandler_t sa_handler;
+      void (*sa_sigaction) (int, siginfo_t *, void *);
+    } __sigaction_handler;
+# define sa_handler    __sigaction_handler.sa_handler
+# define sa_sigaction  __sigaction_handler.sa_sigaction
 
     /* Additional set of signals to be blocked.  */
     __sigset_t sa_mask;
@@ -43,9 +48,21 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK	0x0001	/* Take signal on signal stack.  */
 # define SA_RESTART	0x0002	/* Restart syscall on signal return.  */
+# define SA_NODEFER	0x0010	/* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_RESETHAND	0x0004	/* Reset to SIG_DFL on entry to handler.  */
 #endif
 #define	SA_NOCLDSTOP	0x0008	/* Don't send SIGCHLD when children stop.  */
 
+#ifdef __USE_MISC
+# define SA_INTERRUPT	0	/* Historical no-op ("not SA_RESTART").  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
 
 /* Values for the HOW argument to `sigprocmask'.  */
 #define	SIG_BLOCK	1	/* Block signals.  */
diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h
index 67981e8a2b..e23a96cd9d 100644
--- a/sysdeps/generic/bits/sigaction.h
+++ b/sysdeps/generic/bits/sigaction.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,96,97,98,2001 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,12 @@
 struct sigaction
   {
     /* Signal handler.  */
-    __sighandler_t sa_handler;
+    union {
+      __sighandler_t sa_handler;
+      void (*sa_sigaction) (int, siginfo_t *, void *);
+    } __sigaction_handler;
+# define sa_handler    __sigaction_handler.sa_handler
+# define sa_sigaction  __sigaction_handler.sa_sigaction
 
     /* Additional set of signals to be blocked.  */
     __sigset_t sa_mask;
@@ -43,9 +48,21 @@ struct sigaction
 #if defined __USE_UNIX98 || defined __USE_MISC
 # define SA_ONSTACK	0x0001	/* Take signal on signal stack.  */
 # define SA_RESTART	0x0002	/* Restart syscall on signal return.  */
+# define SA_NODEFER	0x0010	/* Don't automatically block the signal when
+				    its handler is being executed.  */
+# define SA_RESETHAND	0x0004	/* Reset to SIG_DFL on entry to handler.  */
 #endif
 #define	SA_NOCLDSTOP	0x0008	/* Don't send SIGCHLD when children stop.  */
 
+#ifdef __USE_MISC
+# define SA_INTERRUPT	0	/* Historical no-op ("not SA_RESTART").  */
+
+/* Some aliases for the SA_ constants.  */
+# define SA_NOMASK    SA_NODEFER
+# define SA_ONESHOT   SA_RESETHAND
+# define SA_STACK     SA_ONSTACK
+#endif
+
 
 /* Values for the HOW argument to `sigprocmask'.  */
 #define	SIG_BLOCK	1	/* Block signals.  */