diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2004-01-14 05:23:26 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2004-01-14 05:23:26 +0000 |
commit | ba3a1fe6f6a939bb6061bf13a07b569599ae745a (patch) | |
tree | c6853cb91f7dc8a4b8771cd51017f0471acb6d5d /sys/compat/netbsd/netbsd_signal.c | |
parent | b9909d3b24a7a9c97d247379a16ff7683b6d571d (diff) |
change sigaltstack.ss_size type to size_t. handle syscall fallout.
add stack_t and ucontext_t typedefs.
ok deraadt@
Diffstat (limited to 'sys/compat/netbsd/netbsd_signal.c')
-rw-r--r-- | sys/compat/netbsd/netbsd_signal.c | 75 |
1 files changed, 1 insertions, 74 deletions
diff --git a/sys/compat/netbsd/netbsd_signal.c b/sys/compat/netbsd/netbsd_signal.c index abc7ac77381..44c1fcc443c 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.6 2003/06/02 23:28:00 millert Exp $ */ +/* $OpenBSD: netbsd_signal.c,v 1.7 2004/01/14 05:23:25 tedu Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ @@ -55,12 +55,6 @@ static void netbsd_to_openbsd_sigaction(struct netbsd_sigaction *, static void openbsd_to_netbsd_sigaction(struct sigaction *, struct netbsd_sigaction *); -static void netbsd_to_openbsd_sigaltstack(struct netbsd_sigaltstack *, - struct sigaltstack *); - -static void openbsd_to_netbsd_sigaltstack(struct sigaltstack *, - struct netbsd_sigaltstack *); - static void openbsd_to_netbsd_sigaction(obsa, nbsa) struct sigaction *obsa; @@ -84,28 +78,6 @@ netbsd_to_openbsd_sigaction(nbsa, obsa) obsa->sa_flags = nbsa->netbsd_sa_flags; } -static void -netbsd_to_openbsd_sigaltstack(nbss, obss) - struct netbsd_sigaltstack *nbss; - struct sigaltstack *obss; -{ - 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; -} - -static void -openbsd_to_netbsd_sigaltstack(obss, nbss) - struct sigaltstack *obss; - struct netbsd_sigaltstack *nbss; -{ - bzero(nbss, sizeof(nbss)); - nbss->netbsd_ss_sp = obss->ss_sp; - nbss->netbsd_ss_size = (size_t)obss->ss_size; - nbss->netbsd_ss_flags = obss->ss_flags; -} - - /* ARGSUSED */ int netbsd_sys___sigaction14(p, v, retval) @@ -171,51 +143,6 @@ netbsd_sys___sigaction14(p, v, retval) /* ARGSUSED */ int -netbsd_sys___sigaltstack14(p, v, retval) - struct proc *p; - void *v; - register_t *retval; -{ - register struct netbsd_sys___sigaltstack14_args /* { - syscallarg(struct netbsd_sigaltstack *) nss; - syscallarg(struct netbsd_sigaltstack *) oss; - } */ *uap = v; - struct sigacts *psp; - struct sigaltstack ss; - struct netbsd_sigaltstack nbss; - int error; - - psp = p->p_sigacts; - if ((psp->ps_flags & SAS_ALTSTACK) == 0) - psp->ps_sigstk.ss_flags |= SS_DISABLE; - if (SCARG(uap, oss)) { - openbsd_to_netbsd_sigaltstack(&psp->ps_sigstk, &nbss); - if ((error = copyout((caddr_t)&nbss, (caddr_t)SCARG(uap, oss), - sizeof (struct netbsd_sigaltstack)))) - return (error); - } - if (SCARG(uap, nss) == 0) - return (0); - error = copyin((caddr_t)SCARG(uap, nss), (caddr_t)&nbss, sizeof(nbss)); - if (error) - return (error); - netbsd_to_openbsd_sigaltstack(&nbss, &ss); - if (ss.ss_flags & SS_DISABLE) { - if (psp->ps_sigstk.ss_flags & SS_ONSTACK) - return (EINVAL); - psp->ps_flags &= ~SAS_ALTSTACK; - psp->ps_sigstk.ss_flags = ss.ss_flags; - return (0); - } - if (ss.ss_size < MINSIGSTKSZ) - return (ENOMEM); - psp->ps_flags |= SAS_ALTSTACK; - psp->ps_sigstk= ss; - return (0); -} - -/* ARGSUSED */ -int netbsd_sys___sigpending14(p, v, retval) struct proc *p; void *v; |