1
Fork 0
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:
Andreas Kling 2019-11-02 19:34:06 +01:00
parent 73b2cb9ed8
commit cc68654a44
9 changed files with 127 additions and 7 deletions

View file

@ -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;