Introduction to Library Functions TM(3)
NAME
tv - high resolution time support
SYNOPSIS
#include <tv.h>
DESCRIPTION
The tv library supports high resolution Tv_t time specifica-
tions.
Tv_t
contains these elements:
unsigned
_ast_int4_t tv_sec Seconds since the epoch.
unsigned
_ast_int4_t tv_nsec Nanosecond resolution.
In practice resolution is much coarser than 1 nanosecond.
Systems that only support 1 second resolution always set
tv_nsec to 0.
int tvgettime(Tv_t* tv)
Sets tv to the current time. 0 is returned on success, -1
on error.
int tvsettime(const Tv_t* tv)
Sets the system time to tv. The caller must have sufficient
privilege. 0 is returned on success, -1 on error.
int tvcmp(const Tv_t* av, const Tv_t* bv)
Compares the times av and bv and returns -1 if av is less
than bv, 0 if av is equal to bv, and 1 if av is greater than
bv.
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 tv to the st the access, modify, or change
time, respectively. The seconds portion of tv 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 st access, modify, or change time,
respectively, to tv. The seconds portion of tv is returned.
int tvtouch(const char* path, const Tv_t* av, const Tv_t* mv,
const Tv_t* cv, int copy)
Sets the file path access time from av, modify time from mv,
and change time from cv. Any of av, mv, and cv may be 0;
SunOS 5.10 Last change: 1
Introduction to Library Functions TM(3)
the corresponding file time will retain the previous value
if path exists and copy is 1; otherwise the corresponding
file time will be set to the current time. 0 is returned on
success, -1 on error.
int tvsleep(const Tv_t* tv, Tv_t* rv)
Pauses execution for tv time. 0 is returned if the full tv
amount has expired. Otherwise -1 is returned and rv, if not
0, is set to the sleep time remaining.
RETURN VALUE
Except for tvcmp(), an error return of -1 also sets errno to
the corresponding error code.
SEE ALSO
tm(3)
SunOS 5.10 Last change: 2
Generated by GNU enscript 1.6.4.