summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkstailey <kstailey@cvs.openbsd.org>1999-09-16 13:20:07 +0000
committerkstailey <kstailey@cvs.openbsd.org>1999-09-16 13:20:07 +0000
commitc81b670ed8ec8e9bf2171bae918356c308d6d13a (patch)
tree9aa3d8aaa2b09ca46eb848762521e1d97ae4e57d
parentbb316ecffbbeea4de643c643ac8d369b9c52772d (diff)
signal fixes (csh runs)
-rw-r--r--sys/arch/alpha/alpha/netbsd_machdep.c21
-rw-r--r--sys/compat/netbsd/netbsd_misc.c3
-rw-r--r--sys/compat/netbsd/netbsd_signal.c43
3 files changed, 35 insertions, 32 deletions
diff --git a/sys/arch/alpha/alpha/netbsd_machdep.c b/sys/arch/alpha/alpha/netbsd_machdep.c
index 2c6272b9119..128571d3c49 100644
--- a/sys/arch/alpha/alpha/netbsd_machdep.c
+++ b/sys/arch/alpha/alpha/netbsd_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_machdep.c,v 1.1 1999/09/14 01:05:24 kstailey Exp $ */
+/* $OpenBSD: netbsd_machdep.c,v 1.2 1999/09/16 13:20:06 kstailey Exp $ */
/*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -61,14 +61,14 @@ netbsd_to_openbsd_sigcontext(nbsc, obsc)
struct netbsd_sigcontext *nbsc;
struct sigcontext *obsc;
{
- memset(obsc, 0, sizeof(obsc));
+ bzero(obsc, sizeof(obsc));
obsc->sc_onstack = nbsc->sc_onstack;
- memcpy(&obsc->sc_mask, &nbsc->sc_mask.__bits[0], sizeof(sigset_t));
+ bcopy(&nbsc->sc_mask.__bits[0], &obsc->sc_mask, sizeof(sigset_t));
obsc->sc_pc = nbsc->sc_pc;
obsc->sc_ps = nbsc->sc_ps;
- memcpy(obsc->sc_regs, nbsc->sc_regs, sizeof(obsc->sc_regs));
+ bcopy(nbsc->sc_regs, obsc->sc_regs, sizeof(obsc->sc_regs));
obsc->sc_ownedfp = nbsc->sc_ownedfp;
- memcpy(obsc->sc_fpregs, nbsc->sc_fpregs, sizeof(obsc->sc_fpregs));
+ bcopy(nbsc->sc_fpregs, obsc->sc_fpregs, sizeof(obsc->sc_fpregs));
obsc->sc_fpcr = nbsc->sc_fpcr;
obsc->sc_fp_control = nbsc->sc_fp_control;
}
@@ -83,28 +83,29 @@ netbsd_sys___sigreturn14(p, v, retval)
struct netbsd_sys___sigreturn14_args /* {
syscallarg(struct netbsd_sigcontext *) sigcntxp;
} */ *uap = v;
- struct netbsd_sigcontext *nbscp;
struct sigcontext *scp, ksc;
extern struct proc *fpcurproc;
+ struct netbsd_sigcontext *nbscp, nbsc;
nbscp = SCARG(uap, sigcntxp);
- netbsd_to_openbsd_sigcontext(nbscp, scp);
#ifdef DEBUG
if (sigdebug & SDB_FOLLOW)
printf("sigreturn: pid %d, scp %p\n", p->p_pid, scp);
#endif
- if (ALIGN(scp) != (u_int64_t)scp)
+ if (ALIGN(nbscp) != (u_int64_t)nbscp)
return (EINVAL);
/*
* Test and fetch the context structure.
* We grab it all at once for speed.
*/
- if (useracc((caddr_t)scp, sizeof (*scp), B_WRITE) == 0 ||
- copyin((caddr_t)scp, (caddr_t)&ksc, sizeof ksc))
+ if (useracc((caddr_t)nbscp, sizeof (*nbscp), B_WRITE) == 0 ||
+ copyin((caddr_t)nbscp, (caddr_t)&nbsc, sizeof (nbsc)))
return (EINVAL);
+ netbsd_to_openbsd_sigcontext(&nbsc, &ksc);
+
if (ksc.sc_regs[R_ZERO] != 0xACEDBADE) /* magic number */
return (EINVAL);
/*
diff --git a/sys/compat/netbsd/netbsd_misc.c b/sys/compat/netbsd/netbsd_misc.c
index e9f9e7ad072..45559be3ed4 100644
--- a/sys/compat/netbsd/netbsd_misc.c
+++ b/sys/compat/netbsd/netbsd_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_misc.c,v 1.2 1999/09/15 21:00:10 kstailey Exp $ */
+/* $OpenBSD: netbsd_misc.c,v 1.3 1999/09/16 13:20:06 kstailey Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -48,6 +48,7 @@
#include <compat/netbsd/netbsd_syscallargs.h>
/* XXX doesn't do shared address space */
+/*ARGSUSED*/
int
netbsd_sys___vfork14(p, v, retval)
struct proc *p;
diff --git a/sys/compat/netbsd/netbsd_signal.c b/sys/compat/netbsd/netbsd_signal.c
index 793a40f60a5..87a303fabd9 100644
--- a/sys/compat/netbsd/netbsd_signal.c
+++ b/sys/compat/netbsd/netbsd_signal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_signal.c,v 1.3 1999/09/15 18:36:38 kstailey Exp $ */
+/* $OpenBSD: netbsd_signal.c,v 1.4 1999/09/16 13:20:06 kstailey Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
@@ -70,7 +70,7 @@ openbsd_to_netbsd_sigaction(obsa, nbsa)
struct sigaction *obsa;
struct netbsd_sigaction *nbsa;
{
- memset(nbsa, 0, sizeof(struct netbsd_sigaction));
+ bzero(nbsa, sizeof(struct netbsd_sigaction));
nbsa->netbsd_sa_handler = obsa->sa_handler;
bcopy(&obsa->sa_mask, &nbsa->netbsd_sa_mask.__bits[0],
sizeof(sigset_t));
@@ -93,7 +93,6 @@ netbsd_to_openbsd_sigaltstack(nbss, obss)
struct netbsd_sigaltstack *nbss;
struct sigaltstack *obss;
{
- memset(&obss, 0, sizeof(struct sigaltstack));
obss->ss_sp = nbss->netbsd_ss_sp;
obss->ss_size = nbss->netbsd_ss_size; /* XXX may cause truncation */
obss->ss_flags = nbss->netbsd_ss_flags;
@@ -104,9 +103,9 @@ openbsd_to_netbsd_sigaltstack(obss, nbss)
struct sigaltstack *obss;
struct netbsd_sigaltstack *nbss;
{
- memset(&nbss, 0, sizeof(netbsd_stack_t));
+ bzero(nbss, sizeof(nbss));
nbss->netbsd_ss_sp = obss->ss_sp;
- nbss->netbsd_ss_size = obss->ss_size;
+ nbss->netbsd_ss_size = (size_t)obss->ss_size;
nbss->netbsd_ss_flags = obss->ss_flags;
}
@@ -263,23 +262,25 @@ netbsd_sys___sigprocmask14(p, v, retval)
if (error)
return (error);
}
- bcopy(&nss.__bits[0], &obnss, sizeof(sigset_t));
- (void)splhigh();
- switch (SCARG(uap, how)) {
- case SIG_BLOCK:
- p->p_sigmask |= obnss &~ sigcantmask;
- break;
- case SIG_UNBLOCK:
- p->p_sigmask &= ~obnss;
- break;
- case SIG_SETMASK:
- p->p_sigmask = obnss &~ sigcantmask;
- break;
- default:
- error = EINVAL;
- break;
+ if (SCARG(uap, set)) {
+ bcopy(&nss.__bits[0], &obnss, sizeof(sigset_t));
+ (void)splhigh();
+ switch (SCARG(uap, how)) {
+ case SIG_BLOCK:
+ p->p_sigmask |= obnss &~ sigcantmask;
+ break;
+ case SIG_UNBLOCK:
+ p->p_sigmask &= ~obnss;
+ break;
+ case SIG_SETMASK:
+ p->p_sigmask = obnss &~ sigcantmask;
+ break;
+ default:
+ error = EINVAL;
+ break;
+ }
+ (void) spl0();
}
- (void) spl0();
return (error);
}