mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:48:10 +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();
|
||||
}
|
||||
|
||||
int Process::sys$gettimeofday(timeval* tv)
|
||||
int Process::sys$gettimeofday(timeval* user_tv)
|
||||
{
|
||||
REQUIRE_PROMISE(stdio);
|
||||
if (!validate_write_typed(tv))
|
||||
if (!validate_write_typed(user_tv))
|
||||
return -EFAULT;
|
||||
*tv = kgettimeofday();
|
||||
auto tv = kgettimeofday();
|
||||
copy_to_user(user_tv, &tv);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue