Lines Matching refs:pcb

85 	register audit_pcb_t *pcb;  local
98 pcb = &(pcbr->pcb_below[i]); /* get next PCB */
99 while (pcb->pcb_time < 0) { /* while no active record ... */
100 if ((ret = get_file(pcb)) == -1)
104 if (get_recs(pcb, &nrecs) == 0)
105 asort(pcb); /* got a rec - put in list */
111 while ((pcb = aget()) != NULL) { /* get oldest record */
112 if (write_recs(pcbr, pcb, &nprecs))
114 while (pcb->pcb_time < 0) { /* while we don't have a rec */
115 if (pcb->pcb_fpr == NULL) { /* no active file ... */
116 if ((ret = get_file(pcb)) == -1)
121 if (get_recs(pcb, &nrecs) == 0)
122 asort(pcb); /* put record in list */
135 pcb = &(pcbr->pcb_below[0]); /* any old PCB will do */
136 pcb->pcb_rec = empty_file_token;
137 if (write_recs(pcbr, pcb, &junk))
170 asort(pcb) in asort() argument
171 register audit_pcb_t *pcb; in asort()
176 pcb->pcb_next = NULL;
178 pcbls = pcb; /* empty list */
184 if (pcb->pcb_time < pcbc->pcb_time) {
186 pcb->pcb_next = pcbls; /* new -> 1st in list */
187 pcbls = pcb;
190 pcbp->pcb_next = pcb;
191 pcb->pcb_next = pcbc; /* new in the inside */
197 pcbp->pcb_next = pcb; /* new -> last */
236 get_file(pcb) in get_file() argument
237 register audit_pcb_t *pcb; in get_file()
245 while (pcb->pcb_fpr == NULL) {
246 if ((fcb = pcb->pcb_first) == NULL) {
247 pcb->pcb_time = -1;
269 pcb->pcb_first = fcb->fcb_next;
294 pcb->pcb_first = fcb->fcb_next;
301 pcb->pcb_first = fcb->fcb_next;
302 pcb->pcb_cur = fcb;
303 pcb->pcb_fpr = fp;
304 pcb->pcb_nrecs = 0;
305 pcb->pcb_nprecs = 0;
306 pcb->pcb_otime = -1;
325 write_recs(pcbr, pcb, nprecs) in write_recs() argument
326 register audit_pcb_t *pcbr, *pcb; in write_recs()
333 adrm_start(&adr, pcb->pcb_rec);
344 f_start = pcb->pcb_time; /* save start time */
349 f_end = pcb->pcb_time; /* find last record's time */
350 pcb->pcb_time = -1; /* disable just written rec */
352 if ((fwrite(pcb->pcb_rec, sizeof (char), size, pcbr->pcb_fpw)) !=
364 free(pcb->pcb_rec);
379 get_recs(pcb, nr) in get_recs() argument
380 register audit_pcb_t *pcb; in get_recs()
398 ret = get_record(pcb->pcb_fpr, &pcb->pcb_rec,
399 pcb->pcb_cur->fcb_name);
401 adrm_start(&adr, pcb->pcb_rec);
477 pcb->pcb_procno, ret, pcb->pcb_nrecs + 1);
484 if (pcb->pcb_nrecs == 0 && (pcb->pcb_flags & PF_USEFILE)) {
490 (pcb->pcb_cur)->fcb_start = secs;
491 if (!f_all && (m_before <= (pcb->pcb_cur)->fcb_start)) {
492 (void) fclose(pcb->pcb_fpr); /* ignore file */
493 pcb->pcb_fpr = NULL;
494 pcb->pcb_time = -1;
501 ar, (pcb->pcb_cur)->fcb_file);
507 pcb->pcb_time = secs; /* time of record */
508 pcb->pcb_nrecs++; /* # of read recs from stream */
511 if (pcb->pcb_flags & PF_USEFILE) {
512 check_order(pcb); /* check time sequence */
513 if ((ret2 = check_rec(pcb)) == 0) {
514 pcb->pcb_nprecs++;
520 free(pcb->pcb_rec);
523 free(pcb->pcb_rec);
526 pcb->pcb_nprecs++;
537 get_trace(pcb);
541 pcb->pcb_nrecs++; /* # of read records */
543 if (pcb->pcb_flags & PF_USEFILE) {
545 if (!strstr((pcb->pcb_cur)->fcb_file,
548 (pcb->pcb_cur)->fcb_file, pcb->pcb_nrecs);
552 pcb->pcb_nrecs);
560 if (pcb->pcb_flags & PF_USEFILE)
561 (pcb->pcb_cur)->fcb_flags |= FF_DELETE;
563 if (fclose(pcb->pcb_fpr) == EOF) {
565 if (pcb->pcb_flags & PF_USEFILE) {
566 str = (pcb->pcb_cur)->fcb_file;
575 pcb->pcb_fpr = NULL;
576 pcb->pcb_time = -1;
596 get_trace(pcb) in get_trace() argument
597 audit_pcb_t *pcb; in get_trace()
602 if (pcb->pcb_flags & PF_USEFILE) {
604 %d record written.\n", ar, (pcb->pcb_cur)->fcb_file,
605 pcb->pcb_nrecs, pcb->pcb_nprecs);
608 %d records written .\n", ar, pcb->pcb_nrecs,
609 pcb->pcb_nprecs);
625 check_rec(pcb) in check_rec() argument
626 register audit_pcb_t *pcb; in check_rec()
637 adrm_start(&adr, pcb->pcb_rec);
658 pcb->pcb_procno, pcb->pcb_nrecs, tokenid);
771 pcb->pcb_otime = pcb->pcb_time;
801 "file %s\n"), tokenid, (pcb->pcb_cur)->fcb_file);
833 check_order(pcb) in check_order() argument
834 register audit_pcb_t *pcb; in check_order()
841 if (pcb->pcb_otime > pcb->pcb_time) {
844 (void *)ctime(&pcb->pcb_otime), 26);
847 (void *)ctime(&pcb->pcb_time), 26);
851 ar, (pcb->pcb_cur)->fcb_file, cptr1, cptr2);