Introduce clock_nanosleep()

This commit is contained in:
Justine Tunney 2022-10-05 06:37:15 -07:00
parent fe3216e961
commit b75a4654cf
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
33 changed files with 553 additions and 100 deletions

View file

@ -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;