mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
Kernel+LibC: Implement clock_gettime() and clock_nanosleep()
Only the CLOCK_MONOTONIC clock is supported at the moment, and it only has millisecond precision. :^)
This commit is contained in:
parent
73b2cb9ed8
commit
cc68654a44
9 changed files with 127 additions and 7 deletions
|
@ -8,6 +8,7 @@
|
|||
|
||||
extern "C" {
|
||||
struct timeval;
|
||||
struct timespec;
|
||||
}
|
||||
|
||||
#define ENUMERATE_SYSCALLS \
|
||||
|
@ -131,7 +132,9 @@ struct timeval;
|
|||
__ENUMERATE_SYSCALL(realpath) \
|
||||
__ENUMERATE_SYSCALL(get_process_name) \
|
||||
__ENUMERATE_SYSCALL(fchdir) \
|
||||
__ENUMERATE_SYSCALL(getrandom)
|
||||
__ENUMERATE_SYSCALL(getrandom) \
|
||||
__ENUMERATE_SYSCALL(clock_gettime) \
|
||||
__ENUMERATE_SYSCALL(clock_nanosleep)
|
||||
|
||||
namespace Syscall {
|
||||
|
||||
|
@ -181,6 +184,13 @@ struct SC_select_params {
|
|||
struct timeval* timeout;
|
||||
};
|
||||
|
||||
struct SC_clock_nanosleep_params {
|
||||
int clock_id;
|
||||
int flags;
|
||||
const struct timespec* requested_sleep;
|
||||
struct timespec* remaining_sleep;
|
||||
};
|
||||
|
||||
struct SC_sendto_params {
|
||||
int sockfd;
|
||||
const void* data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue