Expose POSIX sleep
This commit is contained in:
parent
60799c824e
commit
37a8bebd1b
@ -7,6 +7,7 @@
|
||||
#define STDERR_FILENO 2
|
||||
|
||||
int syscall(int number, ...);
|
||||
unsigned int sleep(unsigned int seconds);
|
||||
|
||||
#endif /* __UNISTD_H__ */
|
||||
|
||||
|
@ -13,11 +13,12 @@ src_common = [
|
||||
"exit.c",
|
||||
"file.c",
|
||||
"malloc.c",
|
||||
"printf.c",
|
||||
"process.c",
|
||||
"posix/mman.c",
|
||||
"string.c",
|
||||
"syscall.c",
|
||||
"time.c",
|
||||
"printf.c",
|
||||
"posix/mman.c",
|
||||
]
|
||||
|
||||
src_amd64 = [
|
||||
|
15
lib/libc/process.c
Normal file
15
lib/libc/process.c
Normal 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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user