static char Sccsid
[] = "a9.c @(#)a9.c 1.4 10/1/82 Berkeley ";
/* Dyadic i-beam functions. I-beam 63 assumes that the
* "empty" system call (check whether pipe empty) has been
* implemented in the Unix kernel.
arg
= topfix(); /* Get left argument */
case 29: /* Set origin, return old one */
case 30: /* Set width, return old one */
case 31: /* Set number of digits, return old one */
case 34: /* "Nice" system call */
case 35: /* "Sleep" system call */
case 38: /* Sets random seed */
case 63: /* "Empty" system call */
case 90: /* Enable/disable exit with ")off" only */
offexit
= arg
? isatty(0) : arg
;
case 99: /* Buffer flush */
/* Warning -- information is lost if an input pipe
* file descriptor is flushed. No checking is
* made for this i-beam function!!
datum
= zero
; /* No-op if unbuffered */
struct tm
*tp
, *localtime();
register struct nlist
*np
;
case 20: /* time of day */
datum
= t
.proc_user_time
+t
.proc_system_time
;
case 22: /* ws bytes unused */
case 24: /* starting time */
datum
= 60.*(tp
->tm_sec
+60.*(tp
->tm_min
+60.*tp
->tm_hour
));
case 26: /* current line */
datum
= (gsip
? gsip
->funlc
- 1 : 0);
case 27: /* vector of line numbers of fn activations # */
p
->datap
[i
++] = gp
->funlc
- 1;
* non standard I functions
case 28: /* starting date */
datum
= tp
->tm_year
+100.*(tp
->tm_mday
+100.*(tp
->tm_mon
+1));
case 32: /* ws bytes in use */
case 36: /* 2nd element of ib27 */
datum
= ((gsip
&& gsip
->sip
) ? gsip
->sip
->funlc
- 1 : 0);
case 40: /* Total accumulated child's time */
datum
= t
.child_user_time
+t
.child_system_time
;
case 41: /* Total accumulated user time -- including all kids */
datum
= t
.proc_user_time
+t
.child_user_time
;
case 42: /* Total system time -- including all kids */
datum
= t
.proc_system_time
+t
.child_system_time
;
case 43: /* User time -- parent only */
datum
= t
.proc_user_time
;
case 44: /* System time -- parent only */
datum
= t
.proc_system_time
;
case 95: /* dump namelist */
for (np
=nlist
; np
->namep
; np
++)
printf("%s: use=%d, type=%d, itemp=%o, label=%d\n",
np
->namep
, np
->use
, np
->type
, np
->itemp
,
datum
= (sp
- stack
) / 2;
case 98: /* turn off alloc/free trace */
case 99: /* turn on alloc/free trace */