mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:07:35 +00:00
Kernel: Use copy_to_user() in sys$gettimeofday()
This commit is contained in:
parent
3a92d0828d
commit
426c4e387d
1 changed files with 4 additions and 3 deletions
|
@ -2331,12 +2331,13 @@ void kgettimeofday(timeval& tv)
|
||||||
tv = kgettimeofday();
|
tv = kgettimeofday();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Process::sys$gettimeofday(timeval* tv)
|
int Process::sys$gettimeofday(timeval* user_tv)
|
||||||
{
|
{
|
||||||
REQUIRE_PROMISE(stdio);
|
REQUIRE_PROMISE(stdio);
|
||||||
if (!validate_write_typed(tv))
|
if (!validate_write_typed(user_tv))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
*tv = kgettimeofday();
|
auto tv = kgettimeofday();
|
||||||
|
copy_to_user(user_tv, &tv);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue