TIMESPEC_GET(3)

NAME
timespec_get - Set specified timespec structure to a current time

LIBRARY
libc

SYNOPSIS
#include <time.h>
int
timespec_get(struct timespec *ts, int base);

DESCRIPTION
The function timespec_get() takes two arguments, a pointer to a timespec structure and desired time base. The function sets structure pointed by the ts argument to hold current clock time, basing on time base specified in the base argument. Currently only the TIME_UTC base is supported.

RETURN VALUES
Upon successful completion, timespec_get() will use its argument base as a return value. Otherwise, a value of 0 is returned and errno is set to indicate the error.

ERRORS

[EINVAL]
    The base argument to timespec_get() was invalid.

The timespec_get() function may also fail and set errno for any of the errors specified for clock_gettime(2).

SEE ALSO
clock_gettime(2), time(3)

STANDARDS
The timespec_get() function conforms to isoC-2011.