Give up on making clock_nanosleep() precise

Multiple projects I care about make the assumption that this isn't a
system call that sleeps for a particular number of nanonseconds, but
rather a function that parks processes on kernel scheduler quantums.
Anyone who wants the old behavior should use cosmo_clock_nanosleep()
This commit is contained in:
Justine Tunney 2024-02-24 10:00:44 -08:00
parent 99f0491f04
commit 38bceaeb8f
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 150 additions and 109 deletions

View file

@ -19,8 +19,8 @@ int timespec_getres(struct timespec *, int) libcesque;
int timespec_get(struct timespec *, int) libcesque;
#ifdef _COSMO_SOURCE
/* cosmopolitan libc's non-posix timespec library
removed by default due to emacs codebase clash */
int sys_clock_nanosleep(int, int, const struct timespec *, struct timespec *);
int cosmo_clock_nanosleep(int, int, const struct timespec *, struct timespec *);
#define timespec_zero ((struct timespec){0})
#define timespec_max ((struct timespec){0x7fffffffffffffff, 999999999})
libcesque int timespec_cmp(struct timespec, struct timespec) pureconst;