summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-01 21:49:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-01 21:49:54 +0000
commitd1f9e6798948ca75d128ad46760c3788f01d0375 (patch)
tree1502a89484a4620ca7e6470384b8094186db5d4b
parent998c24fd49bf037839de2531c724d288460c20f8 (diff)
add type & union sigval args to sendsig/trapsignal
-rw-r--r--sys/compat/ibcs2/ibcs2_exec.c4
-rw-r--r--sys/compat/sunos/sunos.h4
-rw-r--r--sys/kern/kern_sig.c35
-rw-r--r--sys/sys/proc.h5
-rw-r--r--sys/sys/siginfo.h5
-rw-r--r--sys/sys/signalvar.h7
6 files changed, 41 insertions, 19 deletions
diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c
index f7c394017ba..e874647ef14 100644
--- a/sys/compat/ibcs2/ibcs2_exec.c
+++ b/sys/compat/ibcs2/ibcs2_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibcs2_exec.c,v 1.6 1997/01/27 22:48:30 deraadt Exp $ */
+/* $OpenBSD: ibcs2_exec.c,v 1.7 1997/02/01 21:49:48 deraadt Exp $ */
/* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */
/*
@@ -77,7 +77,7 @@ static int coff_find_section __P((struct proc *, struct vnode *,
extern int bsd2ibcs_errno[];
extern struct sysent ibcs2_sysent[];
extern char *ibcs2_syscallnames[];
-extern void ibcs2_sendsig __P((sig_t, int, int, u_long, caddr_t));
+extern void ibcs2_sendsig __P((sig_t, int, int, u_long, int, union sigval));
extern char sigcode[], esigcode[];
const char ibcs2_emul_path[] = "/emul/ibcs2";
diff --git a/sys/compat/sunos/sunos.h b/sys/compat/sunos/sunos.h
index 65ef0e58073..6513c044cb6 100644
--- a/sys/compat/sunos/sunos.h
+++ b/sys/compat/sunos/sunos.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunos.h,v 1.5 1997/01/27 22:48:33 deraadt Exp $ */
+/* $OpenBSD: sunos.h,v 1.6 1997/02/01 21:49:53 deraadt Exp $ */
/* $NetBSD: sunos.h,v 1.8 1996/05/05 16:07:43 veego Exp $ */
#define SUNM_RDONLY 0x01 /* mount fs read-only */
@@ -146,6 +146,6 @@ struct sunos_audio_info {
__BEGIN_DECLS
/* Defined in arch/m68k/m68k/sunos_machdep.c -- sparc uses regular sendsig() */
#ifndef sparc
-void sunos_sendsig __P((sig_t, int, int, u_long, caddr_t));
+void sunos_sendsig __P((sig_t, int, int, u_long, int, union sigval));
#endif
__END_DECLS
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index e8f19c40b25..4aa5bd87f1d 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sig.c,v 1.15 1997/01/27 22:48:36 deraadt Exp $ */
+/* $OpenBSD: kern_sig.c,v 1.16 1997/02/01 21:49:41 deraadt Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/*
@@ -519,11 +519,12 @@ pgsignal(pgrp, signum, checkctty)
* Otherwise, post it normally.
*/
void
-trapsignal(p, signum, code, addr)
+trapsignal(p, signum, code, type, sigval)
struct proc *p;
register int signum;
u_long code;
- caddr_t addr;
+ int type;
+ union sigval sigval;
{
register struct sigacts *ps = p->p_sigacts;
int mask;
@@ -538,7 +539,7 @@ trapsignal(p, signum, code, addr)
p->p_sigmask, code);
#endif
(*p->p_emul->e_sendsig)(ps->ps_sigact[signum], signum,
- p->p_sigmask, code, addr);
+ p->p_sigmask, code, type, sigval);
p->p_sigmask |= ps->ps_catchmask[signum];
if ((ps->ps_sigreset & mask) != 0) {
p->p_sigcatch &= ~mask;
@@ -1003,7 +1004,8 @@ postsig(signum)
code = ps->ps_code;
ps->ps_code = 0;
}
- (*p->p_emul->e_sendsig)(action, signum, returnmask, code, 0);
+ (*p->p_emul->e_sendsig)(action, signum, returnmask, code,
+ SI_USER, (union sigval *)0);
}
}
@@ -1180,11 +1182,30 @@ sys_nosys(p, v, retval)
}
void
-initsiginfo(si, sig)
+initsiginfo(si, sig, code, type, val)
siginfo_t *si;
int sig;
+ u_long code;
+ int type;
+ union sigval val;
{
bzero(si, sizeof *si);
+
si->si_signo = sig;
- si->si_addr = (caddr_t)-1;
+ si->si_code = type;
+ if (type == SI_USER) {
+ si->si_value = val;
+ } else {
+ switch (sig) {
+ case SIGSEGV:
+ case SIGILL:
+ case SIGBUS:
+ case SIGFPE:
+ si->si_addr = val.sival_ptr;
+ si->si_trapno = code;
+ break;
+ case SIGXFSZ:
+ break;
+ }
+ }
}
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index 6d83564a554..0685ae7c9b8 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.12 1997/01/27 22:48:41 deraadt Exp $ */
+/* $OpenBSD: proc.h,v 1.13 1997/02/01 21:49:30 deraadt Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*-
@@ -75,12 +75,13 @@ struct pgrp {
*/
struct exec_package;
struct ps_strings;
+union sigval;
struct emul {
char e_name[8]; /* Symbolic name */
int *e_errno; /* Errno array */
/* Signal sending function */
- void (*e_sendsig) __P((sig_t, int, int, u_long, caddr_t));
+ void (*e_sendsig) __P((sig_t, int, int, u_long, int, union sigval));
int e_nosys; /* Offset of the nosys() syscall */
int e_nsysent; /* Number of system call entries */
struct sysent *e_sysent; /* System call array */
diff --git a/sys/sys/siginfo.h b/sys/sys/siginfo.h
index 0cae60ceaa3..e333812ffab 100644
--- a/sys/sys/siginfo.h
+++ b/sys/sys/siginfo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: siginfo.h,v 1.3 1997/01/27 23:21:22 deraadt Exp $ */
+/* $OpenBSD: siginfo.h,v 1.4 1997/02/01 21:49:34 deraadt Exp $ */
/*
* Copyright (c) 1997 Theo de Raadt
@@ -205,8 +205,7 @@ typedef struct {
#define si_mstate _data._prof._mstate
#if defined(_KERNEL)
-void initsiginfo __P((siginfo_t *, int));
-void fixsiginfo __P((siginfo_t *, int, u_long, caddr_t));
+void initsiginfo __P((siginfo_t *, int, u_long, int, union sigval));
#endif
#endif /* _SYS_SIGINFO_H */
diff --git a/sys/sys/signalvar.h b/sys/sys/signalvar.h
index e3282f9ae56..bf84942038a 100644
--- a/sys/sys/signalvar.h
+++ b/sys/sys/signalvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: signalvar.h,v 1.5 1997/01/27 22:48:42 deraadt Exp $ */
+/* $OpenBSD: signalvar.h,v 1.6 1997/02/01 21:49:36 deraadt Exp $ */
/* $NetBSD: signalvar.h,v 1.17 1996/04/22 01:23:31 christos Exp $ */
/*
@@ -161,7 +161,8 @@ void pgsignal __P((struct pgrp *pgrp, int sig, int checkctty));
void postsig __P((int sig));
void psignal __P((struct proc *p, int sig));
void siginit __P((struct proc *p));
-void trapsignal __P((struct proc *p, int sig, u_long code, caddr_t addr));
+void trapsignal __P((struct proc *p, int sig, u_long code, int type,
+ union sigval val));
void sigexit __P((struct proc *, int));
void setsigvec __P((struct proc *, int, struct sigaction *));
int killpg1 __P((struct proc *, int, int, int));
@@ -170,7 +171,7 @@ int killpg1 __P((struct proc *, int, int, int));
* Machine-dependent functions:
*/
void sendsig __P((sig_t action, int sig, int returnmask, u_long code,
- caddr_t addr));
+ int type, union sigval val));
struct core;
struct vnode;
struct ucred;