diff options
-rw-r--r-- | Kernel/Process.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 6ed4f5105f..24dc7b9e4f 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -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; } |