toaruos/libc/unistd/usleep.c

12 lines
239 B
C
Raw Normal View History

#include <unistd.h>
#include <syscall.h>
#include <syscall_nums.h>
2021-05-31 04:47:02 +03:00
DEFN_SYSCALL2(sleep, SYS_SLEEP, unsigned long, unsigned long);
int usleep(useconds_t usec) {
2021-05-31 04:47:02 +03:00
syscall_sleep((usec / 10000) / 1000, (usec / 10000) % 1000);
return 0;
}