diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_fork.c | 53 | ||||
-rw-r--r-- | sys/kern/syscalls.master | 4 |
2 files changed, 4 insertions, 53 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 56eae96d07c..62ed83d6e0f 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.137 2012/04/12 10:11:41 mikeb Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.138 2012/04/12 12:33:03 deraadt Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -114,47 +114,6 @@ sys_vfork(struct proc *p, void *v, register_t *retval) } int -sys_rfork(struct proc *p, void *v, register_t *retval) -{ - struct sys_rfork_args /* { - syscallarg(int) flags; - } */ *uap = v; - - int rforkflags; - int flags; - - flags = FORK_RFORK; - rforkflags = SCARG(uap, flags); - - if ((rforkflags & RFPROC) == 0) - return (EINVAL); - - switch(rforkflags & (RFFDG|RFCFDG)) { - case (RFFDG|RFCFDG): - return EINVAL; - case RFCFDG: - flags |= FORK_CLEANFILES; - break; - case RFFDG: - break; - default: - flags |= FORK_SHAREFILES; - break; - } - - if (rforkflags & RFNOWAIT) - flags |= FORK_NOZOMBIE; - - if (rforkflags & RFMEM) - flags |= FORK_SHAREVM; - - if (rforkflags & RFTHREAD) - flags |= FORK_THREAD | FORK_SIGHAND | FORK_NOZOMBIE; - - return (fork1(p, SIGCHLD, flags, NULL, 0, NULL, NULL, retval, NULL)); -} - -int sys___tfork(struct proc *p, void *v, register_t *retval) { struct sys___tfork_args /* { @@ -167,7 +126,6 @@ sys___tfork(struct proc *p, void *v, register_t *retval) if ((error = copyin(SCARG(uap, param), ¶m, sizeof(param)))) return (error); - /* XXX will supersede rfork at some point... */ if (param.tf_flags != 0) return (EINVAL); @@ -370,9 +328,7 @@ fork1(struct proc *curp, int exitsig, int flags, void *stack, pid_t *tidptr, if (p->p_textvp) vref(p->p_textvp); - if (flags & FORK_CLEANFILES) - p->p_fd = fdinit(curp); - else if (flags & FORK_SHAREFILES) + if (flags & FORK_SHAREFILES) p->p_fd = fdshare(curp); else p->p_fd = fdcopy(curp); @@ -434,13 +390,8 @@ fork1(struct proc *curp, int exitsig, int flags, void *stack, pid_t *tidptr, } else if (flags & FORK_VFORK) { forkstat.cntvfork++; forkstat.sizvfork += vm->vm_dsize + vm->vm_ssize; -#if 0 } else if (flags & FORK_TFORK) { forkstat.cnttfork++; -#endif - } else if (flags & FORK_RFORK) { - forkstat.cntrfork++; - forkstat.sizrfork += vm->vm_dsize + vm->vm_ssize; } else { forkstat.cntkthread++; forkstat.sizkthread += vm->vm_dsize + vm->vm_ssize; diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 71f274ffc89..5a48907c854 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -1,4 +1,4 @@ -; $OpenBSD: syscalls.master,v 1.122 2012/04/12 11:16:24 deraadt Exp $ +; $OpenBSD: syscalls.master,v 1.123 2012/04/12 12:33:03 deraadt Exp $ ; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $ ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -427,7 +427,7 @@ 249 UNIMPL 250 STD { int sys_minherit(void *addr, size_t len, \ int inherit); } -251 STD { int sys_rfork(int flags); } +251 OBSOL rfork 252 STD { int sys_poll(struct pollfd *fds, \ u_int nfds, int timeout); } 253 STD NOLOCK { int sys_issetugid(void); } |