feat(systime): gettimeofday/itimer/utimes

This commit is contained in:
2026-09-05 22:43:39 -04:00
parent d495d3eb89
commit c67e890b17
8 changed files with 780 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <sys/time.h>
#include "../internal/syscall.h"
#if VLIBC_LEVEL_GE(2)
/*
* setitimer: arm (or disarm) interval timer which (ITIMER_REAL,
* ITIMER_VIRTUAL or ITIMER_PROF), via SYS_setitimer. struct itimerval is
* layout-identical to the kernel's two-timeval structure on x86_64, so both
* pointers pass straight through: value NULL leaves the timer unchanged,
* it_value zero disarms it, and the previous setting is stored through
* ovalue when it is not NULL. An unknown which or an invalid pointer is
* rejected by the kernel (EINVAL / EFAULT), reported as -1 with errno set.
*/
int
setitimer(int which, const struct itimerval *restrict value, struct itimerval *restrict ovalue)
{
return syscall_ret(__syscall3(SYS_setitimer, which, (long)value, (long)ovalue));
}
#endif /* VLIBC_LEVEL_GE(2) */