mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibC: Add new syscall to allow changing the system date
This commit is contained in:
parent
4484513b45
commit
64c73d0739
Notes:
sideshowbarker
2024-07-19 08:14:18 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/64c73d07390 Pull-request: https://github.com/SerenityOS/serenity/pull/1396 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 7 additions and 0 deletions
|
@ -327,6 +327,12 @@ int clock_gettime(clockid_t clock_id, struct timespec* ts)
|
|||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int clock_settime(clockid_t clock_id, struct timespec* ts)
|
||||
{
|
||||
int rc = syscall(SC_clock_settime, clock_id, ts);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
}
|
||||
|
||||
int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec* requested_sleep, struct timespec* remaining_sleep)
|
||||
{
|
||||
Syscall::SC_clock_nanosleep_params params { clock_id, flags, requested_sleep, remaining_sleep };
|
||||
|
|
|
@ -74,6 +74,7 @@ typedef int clockid_t;
|
|||
#define TIMER_ABSTIME 99
|
||||
|
||||
int clock_gettime(clockid_t, struct timespec*);
|
||||
int clock_settime(clockid_t, struct timespec*);
|
||||
int clock_nanosleep(clockid_t, int flags, const struct timespec* requested_sleep, struct timespec* remaining_sleep);
|
||||
int clock_getres(clockid_t, struct timespec* result);
|
||||
struct tm* gmtime_r(const time_t* timep, struct tm* result);
|
||||
|
|
Loading…
Add table
Reference in a new issue