Kernel: Remove SmapDisabler in sys$clock_settime()
This commit is contained in:
parent
6e9c57fcc3
commit
652b22ee9c
Notes:
sideshowbarker
2024-07-19 06:49:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/652b22ee9ce
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue