projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wait bug fix and cosmetics
[unix-history]
/
usr
/
src
/
sys
/
kern
/
kern_proc.c
diff --git
a/usr/src/sys/kern/kern_proc.c
b/usr/src/sys/kern/kern_proc.c
index
4b14300
..
81a4de2
100644
(file)
--- a/
usr/src/sys/kern/kern_proc.c
+++ b/
usr/src/sys/kern/kern_proc.c
@@
-1,4
+1,4
@@
-/* kern_proc.c 3.
6
%H% */
+/* kern_proc.c 3.
8
%H% */
#include "../h/param.h"
#include "../h/systm.h"
#include "../h/param.h"
#include "../h/systm.h"
@@
-12,7
+12,7
@@
#include "../h/inode.h"
#include "../h/seg.h"
#include "../h/acct.h"
#include "../h/inode.h"
#include "../h/seg.h"
#include "../h/acct.h"
-#include
<wait.h>
+#include
"/usr/include/wait.h"
#include "../h/pte.h"
#include "../h/vm.h"
#include "../h/text.h"
#include "../h/pte.h"
#include "../h/vm.h"
#include "../h/text.h"
@@
-99,7
+99,8
@@
exece()
if ((nc&BMASK) == 0) {
if (bp)
bdwrite(bp);
if ((nc&BMASK) == 0) {
if (bp)
bdwrite(bp);
- bp = getblk(swapdev, (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
+ bp = getblk(swapdev,
+ (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
cp = bp->b_un.b_addr;
}
nc++;
cp = bp->b_un.b_addr;
}
nc++;
@@
-253,7
+254,8
@@
register struct inode *ip;
ds = clrnd(btoc((u.u_exdata.ux_dsize+u.u_exdata.ux_bsize)));
ss = clrnd(SSIZE + btoc(nargc));
if (overlay) {
ds = clrnd(btoc((u.u_exdata.ux_dsize+u.u_exdata.ux_bsize)));
ss = clrnd(SSIZE + btoc(nargc));
if (overlay) {
- if ((u.u_procp->p_flag & SPAGI) || u.u_sep==0 && ctos(ts) != ctos(u.u_tsize) || nargc) {
+ if ((u.u_procp->p_flag & SPAGI) ||
+ u.u_sep==0 && ctos(ts) != ctos(u.u_tsize) || nargc) {
u.u_error = ENOMEM;
goto bad;
}
u.u_error = ENOMEM;
goto bad;
}
@@
-493,13
+495,27
@@
done:
q->p_ppid = 1;
wakeup((caddr_t)&proc[1]);
/*
q->p_ppid = 1;
wakeup((caddr_t)&proc[1]);
/*
- *
Stopped or t
raced processes are killed
+ *
T
raced processes are killed
* since their existence means someone is screwing up.
* since their existence means someone is screwing up.
+ * Traced processes are sent a hangup and a continue.
+ * This is designed to be ``safe'' for setuid
+ * processes since they must be willing to tolerate
+ * hangups anyways.
*/
*/
- if (q->p_
stat == SSTOP || q->p_
flag&STRC) {
+ if (q->p_flag&STRC) {
q->p_flag &= ~STRC;
psignal(q, SIGKILL);
q->p_flag &= ~STRC;
psignal(q, SIGKILL);
+ } else if (q->p_stat == SSTOP) {
+ psignal(q, SIGHUP);
+ psignal(q, SIGCONT);
}
}
+ /*
+ * Protect this process from future
+ * tty signals, and clear TSTP/TTIN/TTOU if pending.
+ */
+ q->p_pgrp = 0;
+#define bit(a) (1<<(a-1))
+ q->p_sig &= ~(bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU));
}
wakeup((caddr_t)p->p_pptr);
psignal(p->p_pptr, SIGCHLD);
}
wakeup((caddr_t)p->p_pptr);
psignal(p->p_pptr, SIGCHLD);