Expose POSIX sleep

This commit is contained in:
Ali Mashtizadeh 2015-01-16 14:51:03 -08:00
parent 60799c824e
commit 37a8bebd1b
3 changed files with 19 additions and 2 deletions

View File

@ -7,6 +7,7 @@
#define STDERR_FILENO 2 #define STDERR_FILENO 2
int syscall(int number, ...); int syscall(int number, ...);
unsigned int sleep(unsigned int seconds);
#endif /* __UNISTD_H__ */ #endif /* __UNISTD_H__ */

View File

@ -13,11 +13,12 @@ src_common = [
"exit.c", "exit.c",
"file.c", "file.c",
"malloc.c", "malloc.c",
"printf.c",
"process.c",
"posix/mman.c",
"string.c", "string.c",
"syscall.c", "syscall.c",
"time.c", "time.c",
"printf.c",
"posix/mman.c",
] ]
src_amd64 = [ src_amd64 = [

15
lib/libc/process.c Normal file
View File

@ -0,0 +1,15 @@
#include <stdint.h>
#include <unistd.h>
#include <syscall.h>
unsigned int
sleep(unsigned int seconds)
{
OSThreadSleep(seconds);
// Should return left over time if woke up early
return 0;
}