TM(3)

NAME
tv - high resolution time support

SYNOPSIS

DESCRIPTION
The tv library supports high resolution Tv_t time specifications.

  Tv_t
contains these elements:

Seconds since the epoch.

Nanosecond resolution.

In practice resolution is much coarser than 1 nanosecond. Systems that only support 1 second resolution always set to 0.

  int tvgettime(Tv_t* tv)
Sets to the current time. is returned on success, on error.

  int tvsettime(const Tv_t* tv)
Sets the system time to The caller must have sufficient privilege. is returned on success, on error.

  int tvcmp(const Tv_t* av, const Tv_t* bv)
Compares the times and and returns if is less than if is equal to and if is greater than

  time_t tvgetatime(const struct stat* st, Tv_t* tv)

  time_t tvgetmtime(const struct stat* st, Tv_t* tv)

  time_t tvgetctime(const struct stat* st, Tv_t* tv)
These macros set to the the access, modify, or change time, respectively. The seconds portion of is returned.

  time_t tvsetatime(struct stat* st, const Tv_t* tv)

  time_t tvsetmtime(struct stat* st, const Tv_t* tv)

  time_t tvsetctime(struct stat* st, const Tv_t* tv)
These macros set the access, modify, or change time, respectively, to The seconds portion of is returned.

  int tvtouch(const char* path, const Tv_t* av, const Tv_t* mv, const Tv_t* cv, int copy)
Sets the file access time from modify time from and change time from Any of and may be 0; the corresponding file time will retain the previous value if exists and is otherwise the corresponding file time will be set to the current time. is returned on success, on error.

  int tvsleep(const Tv_t* tv, Tv_t* rv)
Pauses execution for time. is returned if the full amount has expired. Otherwise is returned and if not 0, is set to the sleep time remaining.

RETURN VALUE
Except for an error return of also sets to the corresponding error code.

SEE ALSO
tm(3)