mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-07 11:48:30 +00:00
Introduce clock_nanosleep()
This commit is contained in:
parent
fe3216e961
commit
b75a4654cf
33 changed files with 553 additions and 100 deletions
|
@ -17,6 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/stat.h"
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/calls/struct/timeval.internal.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/nexgen32e/nexgen32e.h"
|
||||
|
@ -41,16 +42,16 @@ int sys_utimensat_xnu(int dirfd, const char *path, const struct timespec ts[2],
|
|||
if (ts[0].tv_nsec == UTIME_NOW) {
|
||||
tv[0] = now;
|
||||
} else if (ts[0].tv_nsec == UTIME_OMIT) {
|
||||
tv[0] = _timespec2timeval(st.st_atim);
|
||||
tv[0] = _timespec_totimeval(st.st_atim);
|
||||
} else {
|
||||
tv[0] = _timespec2timeval(ts[0]);
|
||||
tv[0] = _timespec_totimeval(ts[0]);
|
||||
}
|
||||
if (ts[1].tv_nsec == UTIME_NOW) {
|
||||
tv[1] = now;
|
||||
} else if (ts[1].tv_nsec == UTIME_OMIT) {
|
||||
tv[1] = _timespec2timeval(st.st_mtim);
|
||||
tv[1] = _timespec_totimeval(st.st_mtim);
|
||||
} else {
|
||||
tv[1] = _timespec2timeval(ts[1]);
|
||||
tv[1] = _timespec_totimeval(ts[1]);
|
||||
}
|
||||
} else {
|
||||
tv[0] = now;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue