2 Copyright © 2008-2018, The AROS Development Team. All rights reserved.
4 POSIX.1-2001 function clock_gettime().
7 #include <proto/exec.h>
8 #include <proto/timer.h>
11 #include "__posixc_time.h"
13 /*****************************************************************************
24 retrieve the time of the specified clock clk_id.
27 clk_id - identifier of the particular clock on which to act
29 System-wide realtime clock. Setting this clock requires appropriate privileges.
31 Clock that cannot be set and represents monotonic time since some unspecified starting point.
32 CLOCK_PROCESS_CPUTIME_ID
33 High-resolution per-process timer from the CPU.
34 CLOCK_THREAD_CPUTIME_ID
35 Thread-specific CPU-time clock.
36 tp - structure to hold the retrieved time value
39 0 on success, -1 on error
42 Currently at most a resolution of milliseconds is supported.
52 ******************************************************************************/
54 struct PosixCIntBase
*PosixCBase
= (struct PosixCIntBase
*)__aros_getbase_PosixCBase();
58 __init_timerbase(PosixCBase
);
68 tp
->tv_sec
= tv
.tv_sec
;
69 tp
->tv_nsec
= tv
.tv_usec
* 1000;
85 tp
->tv_sec
= tv
.tv_sec
;
86 tp
->tv_nsec
= tv
.tv_usec
* 1000;
103 } /* clock_gettime() */