Kernel: Remove SmapDisabler in sys$clock_settime()

This commit is contained in:
Andreas Kling 2020-05-08 22:47:03 +02:00
parent 6e9c57fcc3
commit 652b22ee9c
Notes: sideshowbarker 2024-07-19 06:49:51 +09:00

View file

@ -4360,14 +4360,15 @@ int Process::sys$clock_gettime(clockid_t clock_id, timespec* user_ts)
int Process::sys$clock_settime(clockid_t clock_id, timespec* user_ts) int Process::sys$clock_settime(clockid_t clock_id, timespec* user_ts)
{ {
SmapDisabler disabler;
REQUIRE_PROMISE(stdio); REQUIRE_PROMISE(stdio);
if (!validate_write_typed(user_ts))
timespec ts;
if (!validate_read_and_copy_typed(&ts, user_ts))
return -EFAULT; return -EFAULT;
switch (clock_id) { switch (clock_id) {
case CLOCK_REALTIME: case CLOCK_REALTIME:
TimeManagement::the().set_epoch_time(user_ts->tv_sec); TimeManagement::the().set_epoch_time(ts.tv_sec);
break; break;
default: default:
return -EINVAL; return -EINVAL;