clock_gettime(2) SDK R4.11 clock_gettime(2)
NAME
clock_gettime - get the time of the system clock
SYNOPSIS
#include <time.h>
int clockgettime (clockid, *tp)
clockt clockid;
struct timespec *tp;
DESCRIPTION
Use clockgettime(2) to get the time tp (in seconds and nanoseconds)
of the system-wide realtime clock. The value of clockid must be
CLOCK_REALTIME.
Note
* This routine is based on POSIX realtime extension document P1003.4
draft 14. It is therefore subject to change.
* Compilation of a source file using this routine requires that
feature macro _POSIX4_DRAFT_SOURCE be defined. This feature macro
is not enabled by any other feature macro, nor does it enable any
other feature macro.
* The compiled routine must be linked to library librte.a.
RETURN VALUE
If successful, clockgettime returns 0. If unsuccessful, the routine
returns -1 and sets ERRNO to:
EFAULT The address of tp is bad.
EINVAL The value of clockid is not CLOCK_REALTIME.
SEE ALSO
clockgetres(2). timercreate(2), timerdelete(2), timersettime(2),
timergettime(2), timergetoverrun(2).
Licensed material--property of copyright holder(s)