summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-27 01:15:33 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-01-27 01:15:33 +0000
commitbc11aca5b92d3ec0b32ecd050fa17553c784682c (patch)
treeb2c18b970ce0a743a3e82addf18352aa16adae4c /sys/kern
parent151e3222d7232eee7285dc5b4e8e59ae8bf7b7c4 (diff)
initial cut at SA_SIGINFO support
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sig.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 02707e90685..1c9f7b23c2c 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.13 1996/10/27 08:01:26 tholo Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.14 1997/01/27 01:15:32 deraadt Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -120,6 +120,8 @@ sys_sigaction(p, v, retval)
sa->sa_flags |= SA_RESTART;
if ((ps->ps_sigreset & bit) != 0)
sa->sa_flags |= SA_RESETHAND;
+ if ((ps->ps_siginfo & bit) != 0)
+ sa->sa_flags |= SA_SIGINFO;
if (signum == SIGCHLD) {
if ((p->p_flag & P_NOCLDSTOP) != 0)
sa->sa_flags |= SA_NOCLDSTOP;
@@ -170,6 +172,10 @@ setsigvec(p, signum, sa)
ps->ps_sigreset |= bit;
else
ps->ps_sigreset &= ~bit;
+ if ((sa->sa_flags & SA_SIGINFO) != 0)
+ ps->ps_siginfo |= bit;
+ else
+ ps->ps_siginfo &= ~bit;
if ((sa->sa_flags & SA_RESTART) == 0)
ps->ps_sigintr |= bit;
else
@@ -1171,3 +1177,13 @@ sys_nosys(p, v, retval)
psignal(p, SIGSYS);
return (ENOSYS);
}
+
+void
+initsiginfo(si, sig)
+ siginfo_t *si;
+ int sig;
+{
+ bzero(si, sizeof *si);
+ si->si_signo = sig;
+ si->si_addr = (caddr_t)-1;
+}