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

@ -24,13 +24,11 @@
*
* @return 0 on success, or -1 w/ errno
* @raise EINTR if a signal was delivered while sleeping
* @see nanosleep(), sleep()
* @see clock_nanosleep()
* @norestart
*/
int usleep(uint32_t micros) {
struct timespec ts = {
micros / 1000000,
micros % 1000000 * 1000,
};
struct timespec ts;
ts = _timespec_frommicros(micros);
return nanosleep(&ts, 0);
}