diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-04-12 12:33:05 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2012-04-12 12:33:05 +0000 |
commit | 71f0551d48ea42d77fd272da8e5582257066bc91 (patch) | |
tree | 067a66c69ec9a4b07b3447636a9a0b64f5a58630 /sys | |
parent | bbb2cf89e5c1287c0d503dd8bc14ea689e7883de (diff) |
remove rfork(); ok guenther miod
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_fork.c | 53 | ||||
-rw-r--r-- | sys/kern/syscalls.master | 4 | ||||
-rw-r--r-- | sys/sys/param.h | 19 | ||||
-rw-r--r-- | sys/sys/proc.h | 4 | ||||
-rw-r--r-- | sys/sys/vmmeter.h | 20 |
5 files changed, 15 insertions, 85 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); } diff --git a/sys/sys/param.h b/sys/sys/param.h index 668caa7eac8..5e7d85da538 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.94 2012/01/11 22:11:34 deraadt Exp $ */ +/* $OpenBSD: param.h,v 1.95 2012/04/12 12:33:03 deraadt Exp $ */ /* $NetBSD: param.h,v 1.23 1996/03/17 01:02:29 thorpej Exp $ */ /*- @@ -239,20 +239,3 @@ * change over time. */ #define MAXSLP 20 - -/* - * rfork() options. - * - * XXX currently, operations without RFPROC set are not supported. - */ -#define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */ -#define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */ -#define RFFDG (1<<2) /* copy fd table */ -#define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */ -#define RFPROC (1<<4) /* change child (else changes curproc) */ -#define RFMEM (1<<5) /* share `address space' */ -#define RFNOWAIT (1<<6) /* parent need not wait() on child */ -#define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */ -#define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */ -#define RFCFDG (1<<12) /* zero fd table */ -#define RFTHREAD (1<<13) /* create a thread, not a process */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index e01e2518775..e882c276629 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.156 2012/04/12 10:11:41 mikeb Exp $ */ +/* $OpenBSD: proc.h,v 1.157 2012/04/12 12:33:03 deraadt Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /*- @@ -471,10 +471,8 @@ struct uidinfo *uid_find(uid_t); */ #define FORK_FORK 0x00000001 #define FORK_VFORK 0x00000002 -#define FORK_RFORK 0x00000004 #define FORK_PPWAIT 0x00000008 #define FORK_SHAREFILES 0x00000010 -#define FORK_CLEANFILES 0x00000020 #define FORK_NOZOMBIE 0x00000040 #define FORK_SHAREVM 0x00000080 #define FORK_TFORK 0x00000100 diff --git a/sys/sys/vmmeter.h b/sys/sys/vmmeter.h index bccb4b47329..8583aef0fe8 100644 --- a/sys/sys/vmmeter.h +++ b/sys/sys/vmmeter.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmmeter.h,v 1.12 2003/06/02 23:28:22 millert Exp $ */ +/* $OpenBSD: vmmeter.h,v 1.13 2012/04/12 12:33:03 deraadt Exp $ */ /* $NetBSD: vmmeter.h,v 1.9 1995/03/26 20:25:04 jtc Exp $ */ /*- @@ -41,8 +41,7 @@ */ /* systemwide totals computed every five seconds */ -struct vmtotal -{ +struct vmtotal { u_int16_t t_rq; /* length of the run queue */ u_int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ u_int16_t t_pw; /* jobs in page wait */ @@ -62,26 +61,25 @@ struct vmtotal /* * Fork/vfork/rfork accounting. */ -struct forkstat -{ +struct forkstat { int cntfork; /* number of fork() calls */ int cntvfork; /* number of vfork() calls */ - int cntrfork; /* number of rfork() calls */ + int cnttfork; /* number of rfork() calls */ int cntkthread; /* number of kernel threads created */ int sizfork; /* VM pages affected by fork() */ int sizvfork; /* VM pages affected by vfork() */ - int sizrfork; /* VM pages affected by rfork() */ + int siztfork; /* VM pages affected by rfork() */ int sizkthread; /* VM pages affected by kernel threads */ }; /* These sysctl names are only really used by sysctl(8) */ #define KERN_FORKSTAT_FORK 1 #define KERN_FORKSTAT_VFORK 2 -#define KERN_FORKSTAT_RFORK 3 +#define KERN_FORKSTAT_TFORK 3 #define KERN_FORKSTAT_KTHREAD 4 #define KERN_FORKSTAT_SIZFORK 5 #define KERN_FORKSTAT_SIZVFORK 6 -#define KERN_FORKSTAT_SIZRFORK 7 +#define KERN_FORKSTAT_SIZTFORK 7 #define KERN_FORKSTAT_SIZKTHREAD 8 #define KERN_FORKSTAT_MAXID 9 @@ -89,11 +87,11 @@ struct forkstat { 0, 0 }, \ { "forks", CTLTYPE_INT }, \ { "vforks", CTLTYPE_INT }, \ - { "rforks", CTLTYPE_INT }, \ + { "tforks", CTLTYPE_INT }, \ { "kthreads", CTLTYPE_INT }, \ { "fork_pages", CTLTYPE_INT }, \ { "vfork_pages", CTLTYPE_INT }, \ - { "rfork_pages", CTLTYPE_INT }, \ + { "tfork_pages", CTLTYPE_INT }, \ { "kthread_pages", CTLTYPE_INT }, \ } #endif /* __VMMETER_H__ */ |