ack/mach/vax4/libbsd4_2/times.c

17 lines
354 B
C
Raw Permalink Normal View History

1987-02-23 18:58:58 +00:00
#include <sys/types.h>
#define Xval(xx) ((xx).l1*60+(xx).l2/(100000/6))
times(bp)
struct { time_t l1,l2,l3,l4;} *bp;
{
struct { struct { long l1,l2; }s1,s2; long x[20]; } t;
if (getrusage(0,&t) < 0) return -1;
bp->l1 = Xval(t.s1);
bp->l2 = Xval(t.s2);
if (getrusage(-1,&t) < 0) return -1;
bp->l3 = Xval(t.s1);
bp->l4 = Xval(t.s2);
return 0;
}