diff options
author | phk <phk@FreeBSD.org> | 1994-10-10 01:00:49 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-10-10 01:00:49 +0000 |
commit | 1395bb079155f98b822053a449dc27c2464a7696 (patch) | |
tree | 69495adfa6905b36a3a5e13ef6f010eb90150a20 | |
parent | 1d21d570b618051ef79ea5ceeb164d1894dab514 (diff) | |
download | FreeBSD-src-1395bb079155f98b822053a449dc27c2464a7696.zip FreeBSD-src-1395bb079155f98b822053a449dc27c2464a7696.tar.gz |
Cosmetics. related to getting prototypes into view.
-rw-r--r-- | sys/kern/kern_fork.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_proc.c | 3 | ||||
-rw-r--r-- | sys/kern/kern_resource.c | 5 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 106 | ||||
-rw-r--r-- | sys/kern/sys_generic.c | 4 |
5 files changed, 64 insertions, 58 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 06b3303..b151b84 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_fork.c 8.6 (Berkeley) 4/8/94 - * $Id: kern_fork.c,v 1.7 1994/10/02 04:45:47 davidg Exp $ + * $Id: kern_fork.c,v 1.8 1994/10/09 07:34:55 davidg Exp $ */ #include <sys/param.h> @@ -51,6 +51,8 @@ #include <sys/acct.h> #include <sys/ktrace.h> +#include <vm/vm.h> + static int fork1(struct proc *, int, int *); struct fork_args { diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index a89b40d..527d53b 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)kern_proc.c 8.4 (Berkeley) 1/4/94 - * $Id: kern_proc.c,v 1.7 1994/10/02 04:45:48 davidg Exp $ + * $Id: kern_proc.c,v 1.8 1994/10/09 07:34:57 davidg Exp $ */ #include <sys/param.h> @@ -58,7 +58,6 @@ volatile struct proc *allproc; /* all processes */ struct proc *zombproc; /* just zombies */ void pgdelete __P((struct pgrp *)); -void fixjobc __P((struct proc *, struct pgrp *, int)); /* * Structure associated with user cacheing. diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 6d2c274..1739239 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_resource.c 8.5 (Berkeley) 1/21/94 - * $Id: kern_resource.c,v 1.5 1994/09/25 19:33:42 phk Exp $ + * $Id: kern_resource.c,v 1.6 1994/10/02 04:45:49 davidg Exp $ */ #include <sys/param.h> @@ -49,6 +49,9 @@ #include <vm/vm.h> +int donice __P((struct proc *, struct proc *, int)); +int dosetrlimit __P((struct proc *, u_int, struct rlimit *)); + /* * Resource controls and accounting. */ diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 7a5e5f8..5ba8887 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)kern_sig.c 8.7 (Berkeley) 4/18/94 - * $Id: kern_sig.c,v 1.5 1994/09/25 19:33:43 phk Exp $ + * $Id: kern_sig.c,v 1.6 1994/09/30 00:38:34 ache Exp $ */ #define SIGPROP /* include signal properties table */ @@ -495,6 +495,56 @@ sigaltstack(p, uap, retval) return (0); } +/* + * Common code for kill process group/broadcast kill. + * cp is calling process. + */ +int +killpg1(cp, signum, pgid, all) + register struct proc *cp; + int signum, pgid, all; +{ + register struct proc *p; + register struct pcred *pc = cp->p_cred; + struct pgrp *pgrp; + int nfound = 0; + + if (all) + /* + * broadcast + */ + for (p = (struct proc *)allproc; p != NULL; p = p->p_next) { + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || + p == cp || !CANSIGNAL(cp, pc, p, signum)) + continue; + nfound++; + if (signum) + psignal(p, signum); + } + else { + if (pgid == 0) + /* + * zero pgid means send to my process group. + */ + pgrp = cp->p_pgrp; + else { + pgrp = pgfind(pgid); + if (pgrp == NULL) + return (ESRCH); + } + for (p = pgrp->pg_mem; p != NULL; p = p->p_pgrpnxt) { + if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || + p->p_stat == SZOMB || + !CANSIGNAL(cp, pc, p, signum)) + continue; + nfound++; + if (signum) + psignal(p, signum); + } + } + return (nfound ? 0 : ESRCH); +} + struct kill_args { int pid; int signum; @@ -552,56 +602,6 @@ okillpg(p, uap, retval) #endif /* COMPAT_43 || COMPAT_SUNOS */ /* - * Common code for kill process group/broadcast kill. - * cp is calling process. - */ -int -killpg1(cp, signum, pgid, all) - register struct proc *cp; - int signum, pgid, all; -{ - register struct proc *p; - register struct pcred *pc = cp->p_cred; - struct pgrp *pgrp; - int nfound = 0; - - if (all) - /* - * broadcast - */ - for (p = (struct proc *)allproc; p != NULL; p = p->p_next) { - if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || - p == cp || !CANSIGNAL(cp, pc, p, signum)) - continue; - nfound++; - if (signum) - psignal(p, signum); - } - else { - if (pgid == 0) - /* - * zero pgid means send to my process group. - */ - pgrp = cp->p_pgrp; - else { - pgrp = pgfind(pgid); - if (pgrp == NULL) - return (ESRCH); - } - for (p = pgrp->pg_mem; p != NULL; p = p->p_pgrpnxt) { - if (p->p_pid <= 1 || p->p_flag & P_SYSTEM || - p->p_stat == SZOMB || - !CANSIGNAL(cp, pc, p, signum)) - continue; - nfound++; - if (signum) - psignal(p, signum); - } - } - return (nfound ? 0 : ESRCH); -} - -/* * Send a signal to a process group. */ void @@ -962,8 +962,8 @@ issignal(p) * Are you sure you want to ignore SIGSEGV * in init? XXX */ - printf("Process (pid %d) got signal %d\n", - p->p_pid, signum); + printf("Process (pid %lu) got signal %d\n", + (u_long)p->p_pid, signum); #endif break; /* == ignore */ } diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 5541b07..c9d641a 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)sys_generic.c 8.5 (Berkeley) 1/21/94 - * $Id: sys_generic.c,v 1.6 1994/09/25 19:33:48 phk Exp $ + * $Id: sys_generic.c,v 1.7 1994/10/02 17:35:24 phk Exp $ */ #include <sys/param.h> @@ -58,6 +58,8 @@ #endif #include <vm/vm.h> +int selscan __P((struct proc *, fd_set *, fd_set *, int, int *)); + /* * Read system call. */ |