File:  [Micropolis - Activity] / micropolis / src / tclx / ossupp / times.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed Mar 11 09:08:51 2020 UTC (6 years, 4 months ago) by root
Branches: donhopkins, MAIN
CVS tags: activity, HEAD
Micropolis Activity

/*
 * times.c
 *
 * Public-domain relatively quick-and-dirty implemenation of
 * ANSI library routine for System V Unix systems.
 *
 * It's written in old-style C for maximal portability.
 *
 * Arnold Robbins
 * January, February, 1991
 *
 * Fixes from [email protected]
 * February 1991
 *-----------------------------------------------------------------------------
 * $Id: times.c,v 1.1.1.1 2020/03/11 09:08:51 root Exp $
 *-----------------------------------------------------------------------------
 */

/*
 * To avoid Unix version problems, this code has been simplified to avoid
 * const and size_t, however this can cause an incompatible definition on
 * ansi-C systems, so a game is played with defines to ignore a strftime
 * declaration in time.h
 */

#include <sys/types.h>
#include <time.h>
#include <sys/times.h>


/* times --- produce process times */

clock_t 
times(buffer)
    struct tms      *buffer;
{
    clock_t clk_time;

    clk_time = clock();
    buffer->tms_utime  = clk_time;
    buffer->tms_utime2 = clk_time;
    buffer->tms_stime  = clk_time;
    buffer->tms_stime2 = clk_time;

    return clk_time;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.