wutnewlib: Add sleep and usleep implementation.

This commit is contained in:
James Benton 2018-05-25 17:13:54 +01:00
parent 76844067dd
commit a5a1bac28c
2 changed files with 15 additions and 0 deletions

View File

@ -5,6 +5,7 @@ set_property(SOURCE crt0.s PROPERTY LANGUAGE C)
add_library(wutnewlib
crt0.s
sleep.c
syscalls.c)
target_include_directories(wutnewlib PRIVATE "${WUT_ROOT}/include")

View File

@ -0,0 +1,14 @@
#include <coreinit/thread.h>
#include <coreinit/systeminfo.h>
#include <coreinit/time.h>
#include <unistd.h>
unsigned sleep(unsigned seconds) {
OSSleepTicks(OSSeconds(seconds));
return 0;
}
int usleep(useconds_t microseconds) {
OSSleepTicks(OSMicroseconds(microseconds));
return 0;
}