From 393aec52440dc47aab9971616b0d7521b8a4f431 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 23 Jul 2001 07:20:28 +0000 Subject: * 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 . --- sysdeps/generic/bits/sigaction.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/generic/bits/sigaction.h b/sysdeps/generic/bits/sigaction.h index 67981e8..e23a96c 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. */ -- cgit v1.1