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 | |
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')
-rw-r--r-- | sys/compat/netbsd/netbsd_signal.c | 75 | ||||
-rw-r--r-- | sys/compat/netbsd/netbsd_signal.h | 8 | ||||
-rw-r--r-- | sys/compat/netbsd/syscalls.master | 12 |
3 files changed, 8 insertions, 87 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; diff --git a/sys/compat/netbsd/netbsd_signal.h b/sys/compat/netbsd/netbsd_signal.h index 51530135fda..8158ef009ee 100644 --- a/sys/compat/netbsd/netbsd_signal.h +++ b/sys/compat/netbsd/netbsd_signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: netbsd_signal.h,v 1.4 2003/06/02 23:28:00 millert Exp $ */ +/* $OpenBSD: netbsd_signal.h,v 1.5 2004/01/14 05:23:25 tedu Exp $ */ /* $NetBSD: signal.h,v 1.42 1998/12/21 10:35:00 drochner Exp $ */ /* @@ -54,10 +54,4 @@ struct netbsd_sigaction { int netbsd_sa_flags; /* see signal options below */ }; -struct netbsd_sigaltstack { - void *netbsd_ss_sp; /* signal stack base */ - size_t netbsd_ss_size; /* signal stack length */ - int netbsd_ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ -}; - #endif /* !_NETBSD_SYS_SIGNAL_H_ */ diff --git a/sys/compat/netbsd/syscalls.master b/sys/compat/netbsd/syscalls.master index 506be6f8809..c1ae49e6b5a 100644 --- a/sys/compat/netbsd/syscalls.master +++ b/sys/compat/netbsd/syscalls.master @@ -1,4 +1,4 @@ -; $OpenBSD: syscalls.master,v 1.20 2003/05/11 19:45:18 deraadt Exp $ +; $OpenBSD: syscalls.master,v 1.21 2004/01/14 05:23:25 tedu Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -148,8 +148,8 @@ 50 NOARGS { int sys_setlogin(const char *namebuf); } 51 NOARGS { int sys_acct(const char *path); } 52 NOARGS { int sys_sigpending(void); } -53 NOARGS { int sys_sigaltstack(const struct sigaltstack *nss, \ - struct sigaltstack *oss); } +53 NOARGS { int sys_osigaltstack(const struct osigaltstack *nss, \ + struct osigaltstack *oss); } 54 NOARGS { int sys_ioctl(int fd, \ u_long com, ... void *data); } 55 NOARGS { int sys_reboot(int opt); } @@ -564,9 +564,9 @@ struct netbsd_stat *ub); } 280 STD { int netbsd_sys___lstat13(char *path, \ struct netbsd_stat *ub); } -281 STD { int netbsd_sys___sigaltstack14( \ - const struct netbsd_sigaltstack *nss, \ - struct netbsd_sigaltstack *oss); } +281 NOARGS { int sys_sigaltstack( \ + const struct sigaltstack *nss, \ + struct sigaltstack *oss); } 282 STD { int netbsd_sys___vfork14(void); } 283 UNIMPL ;283 STD { int netbsd_sys___posix_chown(const char *path, \ |