summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/stat.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <b.gianfo@gmail.com>2020-08-09 14:57:50 -0700
committerAndreas Kling <kling@serenityos.org>2020-08-10 12:52:15 +0200
commit431145148ef2a9141cf176276c89774e0f4eea40 (patch)
treee0716f28d861c9cd21886f95fd169f38181d3d7e /Kernel/Syscalls/stat.cpp
parent8dd78201a449ac9eafa1abf151ce21147495ba86 (diff)
downloadserenity-431145148ef2a9141cf176276c89774e0f4eea40.zip
Kernel: Use Userspace<T> for the fstat syscall
Diffstat (limited to 'Kernel/Syscalls/stat.cpp')
-rw-r--r--Kernel/Syscalls/stat.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Kernel/Syscalls/stat.cpp b/Kernel/Syscalls/stat.cpp
index 33e90443aa..2ea70a1ab5 100644
--- a/Kernel/Syscalls/stat.cpp
+++ b/Kernel/Syscalls/stat.cpp
@@ -31,7 +31,7 @@
namespace Kernel {
-int Process::sys$fstat(int fd, stat* user_statbuf)
+int Process::sys$fstat(int fd, Userspace<stat*> user_statbuf)
{
REQUIRE_PROMISE(stdio);
if (!validate_write_typed(user_statbuf))
@@ -39,8 +39,7 @@ int Process::sys$fstat(int fd, stat* user_statbuf)
auto description = file_description(fd);
if (!description)
return -EBADF;
- stat buffer;
- memset(&buffer, 0, sizeof(buffer));
+ stat buffer = {};
int rc = description->fstat(buffer);
copy_to_user(user_statbuf, &buffer);
return rc;