summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sig.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1994-10-10 01:00:49 +0000
committerphk <phk@FreeBSD.org>1994-10-10 01:00:49 +0000
commit1395bb079155f98b822053a449dc27c2464a7696 (patch)
tree69495adfa6905b36a3a5e13ef6f010eb90150a20 /sys/kern/kern_sig.c
parent1d21d570b618051ef79ea5ceeb164d1894dab514 (diff)
downloadFreeBSD-src-1395bb079155f98b822053a449dc27c2464a7696.zip
FreeBSD-src-1395bb079155f98b822053a449dc27c2464a7696.tar.gz
Cosmetics. related to getting prototypes into view.
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r--sys/kern/kern_sig.c106
1 files changed, 53 insertions, 53 deletions
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 */
}
OpenPOWER on IntegriCloud