Lines Matching defs:pcb

87  *	and then allocates the root pcb. Then it calls mfork() to get
99 audit_pcb_t *pcb;
116 * Allocate the root pcb and set it up.
118 pcb = (audit_pcb_t *)a_calloc(1, sizeof (audit_pcb_t));
119 pcb->pcb_procno = root_pid;
120 pcb->pcb_flags |= PF_ROOT;
121 pcb->pcb_fpw = stdout;
122 pcb->pcb_time = -1;
126 if (mfork(pcb, pcbnum, 0, pcbnum - 1)) {
176 * .call ret = mfork(pcb, nsp, lo, hi).
177 * .arg pcb - ptr to pcb that is root node of the to-be-created tree.
180 * .arg hi - higher limit of pcb range. Index into audit_pcbs.
185 mfork(audit_pcb_t *pcb, int nsp, int lo, int hi)
196 * The range of pcb's to process is small enough now. Do the work.
199 pcb->pcb_flags |= PF_LEAF; /* leaf in process tree */
200 pcb->pcb_below = audit_pcbs; /* proc pcbs from audit_pcbs */
201 gather_pcb(pcb, lo, hi);
202 trim_mem(pcb); /* trim allocated memory */
203 return (mproc(pcb)); /* do the work */
206 * Too many pcb's for one process - must fork.
229 pcb->pcb_below = (audit_pcb_t *)
230 a_calloc(tofork, sizeof (*pcb));
239 pcbn = &pcb->pcb_below[i];
271 c_close(pcb, i); /* close unused streams */
293 gather_pcb(pcb, 0, tofork - 1);
294 trim_mem(pcb); /* free unused memory */
295 return (mproc(pcb));
303 * .call trim_mem(pcb).
304 * .arg pcb - ptr to pcb for current process.
308 trim_mem(audit_pcb_t *pcb)
317 if (pcb->pcb_flags & PF_ROOT)
322 if (pcb->pcb_flags & PF_LEAF) {
323 count = pcb->pcb_count;
326 pcb->pcb_below = (audit_pcb_t *)a_calloc(count, size);
327 /* save this pcb's portion */
328 (void) memcpy((void *) pcb->pcb_below,
329 (void *) &audit_pcbs[pcb->pcb_lo], count * size);
330 rm_mem(pcb);
331 gather_pcb(pcb, 0, count - 1);
337 rm_mem(pcb);
345 * pcb in audit_pcbs[] free the record buffer and all of
348 * .arg pcbr - ptr to pcb of current process.
355 audit_pcb_t *pcb;
367 pcb = &audit_pcbs[i];
368 free(pcb->pcb_rec);
369 for (fcb = pcb->pcb_first; fcb != NULL; /* */) {
386 * .call ret = c_close(pcb, i).
387 * .arg pcb - ptr to the child's parent pcb.
392 c_close(audit_pcb_t *pcb, int i)
401 pcbt = &pcb->pcb_below[j];
422 * .arg pcbn - ptr to pcb.
463 * responsible for. For a pcb that controls processes this is all
464 * of the sub-processes that it forks. For a pcb that controls
466 * .call gather_pcb(pcb, lo, hi).
467 * .arg pcb - ptr to pcb.
473 gather_pcb(audit_pcb_t *pcb, int lo, int hi)
475 pcb->pcb_lo = lo;
476 pcb->pcb_hi = hi;
477 pcb->pcb_count = hi - lo + 1;
600 audit_pcb_t *pcb;
604 pcb = &audit_pcbs[i];
605 fcb = pcb->pcb_dfirst;
897 pcbsize = PCB_INITSIZE; /* initial size of file-holding pcb's */