-/* kern_proc.c 3.9 %H% */
+/* kern_proc.c 3.16 %G% */
#include "../h/param.h"
#include "../h/systm.h"
ne = 0;
nc = 0;
uap = (struct execa *)u.u_ap;
- if ((bno = malloc(swapmap, ctod(clrnd((int) btoc(NCARGS))))) == 0) {
+ if ((bno = malloc(argmap, ctod(clrnd((int) btoc(NCARGS))))) == 0) {
swkill(u.u_procp, "exece");
goto bad;
}
if ((nc&BMASK) == 0) {
if (bp)
bdwrite(bp);
- bp = getblk(swapdev,
- (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
+ bp = getblk(argdev,
+ (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT)));
cp = bp->b_un.b_addr;
}
nc++;
if (getxfile(ip, nc) || u.u_error) {
badarg:
for (c = 0; c < nc; c += BSIZE)
- if (bp = baddr(swapdev, dbtofsb(swplo+bno)+(c>>BSHIFT))) {
+ if (bp = baddr(argdev, dbtofsb(bno)+(c>>BSHIFT))) {
bp->b_flags |= B_AGE; /* throw away */
bp->b_flags &= ~B_DELWRI; /* cancel io */
brelse(bp);
if ((nc&BMASK) == 0) {
if (bp)
brelse(bp);
- bp = bread(swapdev,
- (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
+ bp = bread(argdev,
+ (daddr_t)(dbtofsb(bno)+(nc>>BSHIFT)));
bp->b_flags |= B_AGE; /* throw away */
bp->b_flags &= ~B_DELWRI; /* cancel io */
cp = bp->b_un.b_addr;
if (bp)
brelse(bp);
if (bno)
- mfree(swapmap, ctod(clrnd((int) btoc(NCARGS))), bno);
+ mfree(argmap, ctod(clrnd((int) btoc(NCARGS))), bno);
iput(ip);
}
1 + ts/CLSIZE, (int)btoc(u.u_exdata.ux_dsize));
/* THIS SHOULD BE DONE AT A LOWER LEVEL, IF AT ALL */
- mtpr(TBIA,1);
+ mtpr(TBIA, 0);
/*
* set SUID/SGID protections, if no tracing
else
p->p_siga1 = 0;
(void) spl0();
- rate.v_pgin -= p->p_aveflt;
p->p_aveflt = 0;
for(i=0; i<NSIG; i++)
u.u_signal[i] = SIG_IGN;
plock(u.u_rdir);
iput(u.u_rdir);
}
+ u.u_limit[LIM_FSIZE] = INFINITY;
acct();
vrelpt(u.u_procp);
vrelu(u.u_procp, 0);
multprog--;
- spl7(); /* clock will get mad because of overlaying */
+/* spl7(); /* clock will get mad because of overlaying */
+ noproc = 1;
p->p_stat = SZOMB;
i = PIDHASH(p->p_pid);
x = p - proc;
/*
* Traced processes are killed
* since their existence means someone is screwing up.
- * Traced processes are sent a hangup and a continue.
+ * Stopped 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.
}
/*
* Protect this process from future
- * tty signals, and clear TSTP/TTIN/TTOU if pending.
+ * tty signals, clear TSTP/TTIN/TTOU if pending,
+ * and set SDETACH bit on procs.
*/
- q->p_pgrp = 0;
-#define bit(a) (1<<(a-1))
- q->p_sig &= ~(bit(SIGTSTP)|bit(SIGTTIN)|bit(SIGTTOU));
+ spgrp(q, -1);
}
wakeup((caddr_t)p->p_pptr);
psignal(p->p_pptr, SIGCHLD);
if (n < 0)
n = 0;
d = clrnd(n - u.u_dsize);
+ if (u.u_dsize+d > u.u_limit[LIM_DATA]) {
+ u.u_error = ENOMEM;
+ return;
+ }
if (chksize(u.u_tsize, u.u_dsize+d, u.u_ssize))
return;
if (swpexpand(u.u_dsize+d, u.u_ssize, &u.u_dmap, &u.u_smap)==0)