Lines Matching refs:ps
2718 static const char *expandstr(const char *ps, int syntax_type);
3625 struct procstat *ps; /* status of processes when more than one */ member
3865 struct procstat *ps = jp->ps;
3867 status = ps[i].ps_status;
4009 if (match(jp->ps[0].ps_cmd, p)) { in getjob()
4038 struct procstat *ps; in freejob() local
4042 for (i = jp->nprocs, ps = jp->ps; --i >= 0; ps++) { in freejob()
4043 if (ps->ps_cmd != nullstr) in freejob()
4044 free(ps->ps_cmd); in freejob()
4046 if (jp->ps != &jp->ps0) in freejob()
4047 free(jp->ps); in freejob()
4173 struct procstat *ps = &jp->ps[j]; in killcmd() local
4177 if (ps->ps_status != -1 && !WIFSTOPPED(ps->ps_status)) in killcmd()
4184 dst += sprintf(dst, jp->jobctl ? " -%u" : " %u", (int)ps->ps_pid); in killcmd()
4196 struct procstat *ps; in showpipe() local
4199 psend = jp->ps + jp->nprocs; in showpipe()
4200 for (ps = jp->ps + 1; ps < psend; ps++) in showpipe()
4201 printf(" | %s", ps->ps_cmd); in showpipe()
4210 struct procstat *ps; in restartjob() local
4219 pgid = jp->ps[0].ps_pid; in restartjob()
4225 ps = jp->ps; in restartjob()
4228 if (WIFSTOPPED(ps->ps_status)) { in restartjob()
4229 ps->ps_status = -1; in restartjob()
4231 ps++; in restartjob()
4255 out1str(jp->ps[0].ps_cmd); in fg_bgcmd()
4379 struct procstat *ps; in waitone() local
4384 ps = jp->ps; in waitone()
4385 psend = ps + jp->nprocs; in waitone()
4387 if (ps->ps_pid == pid) { in waitone()
4390 jobno(jp), pid, ps->ps_status, status)); in waitone()
4391 ps->ps_status = status; in waitone()
4394 if (ps->ps_status == -1) in waitone()
4399 if (WIFSTOPPED(ps->ps_status)) { in waitone()
4400 jp->stopstatus = ps->ps_status; in waitone()
4404 } while (++ps < psend); in waitone()
4435 pid = thisjob->ps[thisjob->nprocs - 1].ps_status; in waitone()
4482 struct procstat *ps; in showjob() local
4489 ps = jp->ps; in showjob()
4493 fprintf(out, "%d\n", ps->ps_pid); in showjob()
4506 col += fmtstr(s + col, 16, "%d ", ps->ps_pid); in showjob()
4508 psend = ps + jp->nprocs; in showjob()
4535 col = fmtstr(s, 48, "\n%*c%d ", indent_col, ' ', ps->ps_pid) - 1; in showjob()
4540 ps == jp->ps ? "" : "| ", in showjob()
4541 ps->ps_cmd in showjob()
4543 } while (++ps != psend); in showjob()
4607 struct procstat *ps; in getstatus() local
4610 ps = job->ps + job->nprocs - 1; in getstatus()
4611 status = ps->ps_status; in getstatus()
4614 while (status == 0 && --ps >= job->ps) in getstatus()
4615 status = ps->ps_status; in getstatus()
4714 if (job->ps[job->nprocs - 1].ps_pid == pid) in waitcmd()
4759 if (joff(jp)->ps == &jq->ps0) in growjobtab()
4760 jmove(joff(jp)->ps); in growjobtab()
4816 jp->ps = &jp->ps0; in makejob()
4818 jp->ps = ckmalloc(nprocs * sizeof(struct procstat)); in makejob()
5243 pgrp = jp->ps[0].ps_pid; in forkchild()
5310 pgrp = jp->ps[0].ps_pid; in forkparent()
5320 struct procstat *ps = &jp->ps[jp->nprocs++]; in forkparent() local
5321 ps->ps_pid = pid; in forkparent()
5322 ps->ps_status = -1; in forkparent()
5323 ps->ps_cmd = nullstr; in forkparent()
5326 ps->ps_cmd = commandtext(n); in forkparent()
13337 expandstr(const char *ps, int syntax_type) in expandstr() argument
13351 setinputstring((char *)ps); in expandstr()
13357 result = ps; in expandstr()