mirror of
https://github.com/switchbrew/libnx.git
synced 2025-07-05 10:52:15 +02:00
implement nanosleep
This commit is contained in:
parent
8b793729fc
commit
1b0380c2f9
@ -111,9 +111,9 @@ int __libnx_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int usleep(useconds_t useconds)
|
||||
{
|
||||
svcSleepThread(useconds * 1000ull);
|
||||
|
||||
int __libnx_nanosleep(const struct timespec *req, struct timespec *rem) {
|
||||
svcSleepThread(req->tv_sec * 1000000000ull + req->tv_nsec);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -127,6 +127,8 @@ void newlibSetup(void) {
|
||||
__syscalls.clock_getres = __libnx_clock_getres;
|
||||
__syscalls.clock_settime = __libnx_clock_settime;
|
||||
|
||||
__syscalls.nanosleep = __libnx_nanosleep;
|
||||
|
||||
|
||||
// Register locking syscalls
|
||||
__syscalls.lock_init = mutexInit;
|
||||
|
Loading…
Reference in New Issue
Block a user