TM(3)
πΈ NAME πΈ
okay so bestie, welcome to TM(3) from the Library Functions Manual π. This page is all about tv β high resolution time support β and itβs lowkey iconic for anyone doing time stuff. Periodt.
β¨ SYNOPSIS β¨
#include <tv.h>
π DESCRIPTION π
The tv library supports high resolution Tv_t time specifications. Slay.
π«Ά Tv_t
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.
π¦ the tvget* macros, literally
time_t tvgetatime(Tv_t* tv, const struct stat* st)
time_t tvgetmtime(Tv_t* tv, const struct stat* st)
time_t tvgetctime(Tv_t* tv, const struct stat* st)
These macros set tv to the st access, modify, or change time, respectively. The seconds portion of tv is returned.
π the tvset* macros
time_t tvsetatime(Tv_t* tv, struct stat* st)
time_t tvsetmtime(Tv_t* tv, struct stat* st)
time_t tvsetctime(Tv_t* tv, struct stat* st)
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; 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) β go give it a lil look, iykyk π«Ά
Final sign-off bestie: this is the TM(3) page, and the footer is literally just TM(3) β no extra source/version or date info, so thatβs the whole vibe ππβ¨
π¦ where this page comes from
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms