From a7e8defc5298c7f811e3428c2b52e4d81a60fc08 Mon Sep 17 00:00:00 2001 From: Kartik Date: Wed, 13 Jun 2018 18:21:59 +0530 Subject: [PATCH 1/2] Update os.c --- libctru/source/os.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libctru/source/os.c b/libctru/source/os.c index 29ad36a..a52e18d 100644 --- a/libctru/source/os.c +++ b/libctru/source/os.c @@ -164,11 +164,8 @@ void osSetSpeedupEnable(bool enable) __ctru_speedup_config(); } -int usleep(useconds_t useconds) +int __libctru_nanosleep(const struct timespec *req, struct timespec *rem) { - - svcSleepThread(useconds * 1000ull); - + svcSleepThread(req->tv_sec * 1000000000ull + req->tv_nsec); return 0; - } From 299e39aacfcd8e814ee13450d143fc2b87d1fdf9 Mon Sep 17 00:00:00 2001 From: Kartik Date: Wed, 13 Jun 2018 18:23:43 +0530 Subject: [PATCH 2/2] Update syscalls.c --- libctru/source/system/syscalls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libctru/source/system/syscalls.c b/libctru/source/system/syscalls.c index a0c2903..fab453a 100644 --- a/libctru/source/system/syscalls.c +++ b/libctru/source/system/syscalls.c @@ -12,6 +12,7 @@ void __ctru_exit(int rc); int __libctru_gtod(struct _reent *ptr, struct timeval *tp, struct timezone *tz); +int __libctru_nanosleep(const struct timespec *req, struct timespec *rem); extern const u8 __tdata_lma[]; extern const u8 __tdata_lma_end[]; @@ -34,7 +35,8 @@ void __system_initSyscalls(void) __syscalls.exit = __ctru_exit; __syscalls.gettod_r = __libctru_gtod; __syscalls.getreent = __ctru_get_reent; - + __syscalls.nanosleep = __libctru_nanosleep; + // Register locking syscalls __syscalls.lock_init = LightLock_Init; __syscalls.lock_acquire = LightLock_Lock;