summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-20 01:56:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-20 01:56:02 +0000
commit829ad833bc4e3f4b5b269fe6c8d2bfb08afa4435 (patch)
tree4dbeca81b139beb0c17e30740cb39ca5652aca37 /sys
parent602670a23a0cc1ff76649bdd084bc659628156d6 (diff)
create sa_handler and sa_sigaction stubs in struct sigaction, via a
union and cpp. This permits use of either the old or new POSIX names, and gives proper typing for the argument handler. (Sorry for the name space whacking; I'd love to see a better way to do this).
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/signal.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 81a9cd33fd2..e88501848b8 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signal.h,v 1.7 1997/09/15 05:46:14 millert Exp $ */
+/* $OpenBSD: signal.h,v 1.8 1997/09/20 01:55:58 deraadt Exp $ */
/* $NetBSD: signal.h,v 1.21 1996/02/09 18:25:32 christos Exp $ */
/*
@@ -109,14 +109,24 @@
#ifndef _ANSI_SOURCE
typedef unsigned int sigset_t;
+#include <sys/siginfo.h>
+
/*
* Signal vector "template" used in sigaction call.
*/
struct sigaction {
- void (*sa_handler) __P((int)); /* signal handler */
+ union { /* signal handler */
+ void (*__sa_handler) __P((int));
+ void (*__sa_sigaction) __P((int, siginfo_t *, void *));
+ } __sigaction_u;
sigset_t sa_mask; /* signal mask to apply */
int sa_flags; /* see signal options below */
};
+
+/* if SA_SIGINFO is set, sa_sigaction is to be used instead of sa_handler. */
+#define sa_handler __sigaction_u.__sa_handler
+#define sa_sigaction __sigaction_u.__sa_sigaction
+
#ifndef _POSIX_SOURCE
#define SA_ONSTACK 0x0001 /* take signal on signal stack */
#define SA_RESTART 0x0002 /* restart system on signal return */
@@ -186,8 +196,6 @@ struct sigstack {
#define BADSIG SIG_ERR
-#include <sys/siginfo.h>
-
#endif /* !_POSIX_SOURCE */
#endif /* !_ANSI_SOURCE */