# 2.11BSD#431 - /usr/src/lib/libc/compat-4.1/times.c

##### Functions

    times             X

       1: /*
       2:  * Copyright (c) 1980 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #if defined(LIBC_SCCS) && !defined(lint)
       8: static char sccsid[] = "@(#)times.c	5.2 (Berkeley) 3/9/86";
       9: #endif LIBC_SCCS and not lint
      10:
      11: #include <sys/time.h>
      12: #include <sys/resource.h>
      13: #include <sys/types.h>
      14: #include <sys/times.h>
      15:
      16: times(tmsp)
      17:     register struct tms *tmsp;
      18: {
      19:     struct rusage ru;
      20:     long scale60();
      21:
      22:     if (getrusage(RUSAGE_SELF, &ru) < 0)
      23:         return (-1);
      24:     tmsp->tms_utime = scale60(&ru.ru_utime);
      25:     tmsp->tms_stime = scale60(&ru.ru_stime);
      26:     if (getrusage(RUSAGE_CHILDREN, &ru) < 0)
      27:         return (-1);
      28:     tmsp->tms_cutime = scale60(&ru.ru_utime);
      29:     tmsp->tms_cstime = scale60(&ru.ru_stime);
      30:     return (0);
      31: }
      32:
      33: static long
      34: scale60(tvp)
      35:     register struct timeval *tvp;
      36: {
      37:
      38:     return (tvp->tv_sec * 60 + tvp->tv_usec / 16667);
      39: }

#### Defined functions

scale60 defined in line 33; used 5 times

- in line 20-29(5)

times defined in line 16; used 36 times

- in /usr/src/bin/sh/xec.c line 85
- in /usr/src/bin/tcsh/sh.proc.c line 187, 318, 328, 812
- in /usr/src/bin/tcsh/sh.time.c line 88, 130
- in /usr/src/games/pdp/chess/play.c line 35
- in /usr/src/new/OLD/apl/src/a9.c line 110, 186-206(5)
- in /usr/src/new/OLD/apl/src/xed.c line 3307
- in /usr/src/new/PORT/B/src/bint/b3err.c line 437
- in /usr/src/new/PORT/apl/src/a9.c line 110, 186-206(5)
- in /usr/src/new/PORT/perl.1.0.0/arg.c line 568
- in /usr/src/new/PORT/perl.1.0.10/arg.c line 585
- in /usr/src/new/PORT/perl.1.0.16/arg.c line 604
- in /usr/src/new/kermit5.188/ckutio.c line 4938, 4978-4980(2)
- in /usr/src/new/nntp/server/serve.c line 254
- in /usr/src/new/nntp/xmit/nntpxmit.c line 311
- in /usr/src/ucb/pascal/px/34fun.s line 48
- in /usr/src/ucb/pascal/px/perror.c line 204
- in /usr/src/usr.bin/refer/tick.c line 20, 32
- in /usr/src/usr.lib/libU77/dtime_.c line 37
- in /usr/src/usr.lib/libU77/etime_.c line 34

#### Defined variables

sccsid defined in line 8; never used

Last modified: 1987-03-13 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: ?E00 |