|
Last change
on this file since 2227 was 2227, checked in by bird, 20 years ago |
|
Changed utimes() to allow NULL pointer parameter. Please note that BSD will crash in if you try it there.
|
-
Property cvs2svn:cvs-rev
set to
1.5
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
567 bytes
|
| Line | |
|---|
| 1 | /* times.c (emx+gcc) -- Copyright (c) 1990-1996 by Eberhard Mattes */
|
|---|
| 2 |
|
|---|
| 3 | #include "libc-alias.h"
|
|---|
| 4 | #include <time.h>
|
|---|
| 5 | #include <sys/time.h>
|
|---|
| 6 | #include <sys/times.h>
|
|---|
| 7 |
|
|---|
| 8 | /* Note: return value overflows */
|
|---|
| 9 |
|
|---|
| 10 | clock_t _STD(times) (struct tms *buffer)
|
|---|
| 11 | {
|
|---|
| 12 | struct timeval tv;
|
|---|
| 13 | if (buffer)
|
|---|
| 14 | {
|
|---|
| 15 | buffer->tms_utime = clock (); /* clock () * HZ / CLOCKS_PER_SEC */
|
|---|
| 16 | buffer->tms_stime = 0;
|
|---|
| 17 | buffer->tms_cutime = 0;
|
|---|
| 18 | buffer->tms_cstime = 0;
|
|---|
| 19 | }
|
|---|
| 20 | if (gettimeofday (&tv, NULL) != 0)
|
|---|
| 21 | return -1;
|
|---|
| 22 | return CLK_TCK * tv.tv_sec + (CLK_TCK * tv.tv_usec) / 1000000;
|
|---|
| 23 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.