Lines Matching defs:job
54 /* process id of this Unix process in the job */
67 #define JP_MEDIUM 2 /* print [job-num] -/+ command */
68 #define JP_LONG 3 /* print [job-num] -/+ pid command */
76 #define JF_STARTED 0x001 /* set when all processes in job are started */
77 #define JF_WAITING 0x002 /* set if j_waitj() is waiting on job */
89 typedef struct job Job;
90 struct job {
92 Job *next; /* next job in list */
95 struct timeval systime; /* system time used by job */
96 struct timeval usrtime; /* user time used by job */
97 pid_t pgrp; /* process group of job */
98 pid_t ppid; /* pid of process that forked job */
99 int job; /* job number: %n */
101 volatile int state; /* job state */
115 #define JW_STOPPEDWAIT 0x04 /* wait even if job stopped */
119 #define JL_NOSUCH 0 /* no such job */
121 #define JL_INVALID 2 /* non-pid, non-% job id */
124 "no such job",
126 "argument must be %job or process id"
129 static Job *job_list; /* job list */
142 /* held_sigchld is set if sigchld occurs before a job is completely started */
169 /* initialise job control */
284 /* job cleanup before shell exit */
338 /* turn job control on or off according to Flag(FMONITOR) */
359 /* wait to be given tty (POSIX.1, B.2, job control) */
397 "won't have full job control");
468 /* no SIGCHLDs while messing with job and process lists */
489 /* fills in j->job */
535 /* job control set up */
626 /* last process in a job */
633 coproc.job = (void *)j;
638 shf_fprintf(shl_out, "[%d]", j->job);
656 /* start the last job: only used for $(command) jobs */
677 /* wait for last job: only used for $(command) jobs */
692 warningf(true, Tf_sD_s, "waitlast", "no last job");
727 * wait for an unspecified job - always returns 0, so
741 /* don't report normal job completion */
772 /* kill (built-in) a job */
837 bi_errorf("job not job-controlled");
842 shprintf("[%d] ", j->job);
864 /* attach tty to job */
903 bi_errorf(Tf_s_sD_s, "can't continue job",
1016 * Remove job after doing reports so there aren't
1027 j->job = -1;
1039 /* Return pid of last process in last asynchronous job */
1097 * Start a job: set STARTED, check for held signals and set j->last_proc
1114 /* Don't call j_sigchld() as it may remove job... */
1121 * wait for job to complete or change state
1138 * No auto-notify on the job we are waiting on.
1183 * when the job is foregrounded. This is to
1207 * Only restore tty settings if job was originally
1221 * Don't use tty mode if job is stopped and
1238 * If it looks like user hit ^C to kill a job, pretend we got
1320 * SIGCHLD handler to reap children and update job states
1343 * Don't wait for any processes if a job is partially started.
1380 /* find job and process structures for this pid */
1418 /* check to see if entire job is done */
1436 * from j_sigchld()). If no processes are running, the job status
1437 * and state are updated, asynchronous job notification is done and,
1438 * if unneeded, the job is removed.
1450 internal_warningf("check_job: job started (flags 0x%X)",
1476 if (coproc.job == j) {
1477 coproc.job = NULL;
1482 * do "if job == 0 && write >= 0, close write".
1514 * Can't call j_notify() as it removes jobs. The job
1515 * must stay in the job list as j_waitj() may be
1516 * running with this job.
1533 j->job = -1;
1541 * Print job status in either short, medium or long format.
1570 filler = j->job > 10 ? "\n " : "\n ";
1631 shf_fprintf(shf, "[%d] %c ", j->job, jobchar);
1679 * Convert % sequence to job
1689 int job = 0;
1691 if (ctype(*cp, C_DIGIT) && getn(cp, &job)) {
1694 if (j->last_proc && j->last_proc->pid == job)
1701 if (j->pgrp && j->pgrp == job)
1726 if (!getn(cp, &job))
1729 if (j->job == job)
1777 * allocate a new job and fill in the job number.
1794 * struct job includes ALLOC_ITEM for alignment constraints
1807 while (j && j->job != i)
1810 newj->job = i;
1835 * Take job out of job_list and put old structures into free list.
1853 internal_warningf("remove_job: job %s (%s)", Tnot_found, where);
1888 /* Remove job from list (if there) */
1917 * nuke a job (called when unable to start full job).