summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/statvfs.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-12-29 00:10:17 -0800
committerAndreas Kling <kling@serenityos.org>2021-12-29 18:08:15 +0100
commitbad6d50b86ae1e0a46219baf149fa0a3574af9ce (patch)
tree83d0da5a800509416d70555b751cd01244cbe98c /Kernel/Syscalls/statvfs.cpp
parentc4f60844c5d2bd51e70a621753208fe0c9392339 (diff)
downloadserenity-bad6d50b86ae1e0a46219baf149fa0a3574af9ce.zip
Kernel: Use Process::require_promise() instead of REQUIRE_PROMISE()
This change lays the foundation for making the require_promise return an error hand handling the process abort outside of the syscall implementations, to avoid cases where we would leak resources. It also has the advantage that it makes removes a gs pointer read to look up the current thread, then process for every syscall. We can instead go through the Process this pointer in most cases.
Diffstat (limited to 'Kernel/Syscalls/statvfs.cpp')
-rw-r--r--Kernel/Syscalls/statvfs.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/statvfs.cpp b/Kernel/Syscalls/statvfs.cpp
index 93121fe0d1..e917e0bda3 100644
--- a/Kernel/Syscalls/statvfs.cpp
+++ b/Kernel/Syscalls/statvfs.cpp
@@ -40,7 +40,7 @@ ErrorOr<FlatPtr> Process::do_statvfs(FileSystem const& fs, Custody const* custod
ErrorOr<FlatPtr> Process::sys$statvfs(Userspace<const Syscall::SC_statvfs_params*> user_params)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
- REQUIRE_PROMISE(rpath);
+ require_promise(Pledge::rpath);
auto params = TRY(copy_typed_from_user(user_params));
auto path = TRY(get_syscall_path_argument(params.path));
@@ -55,7 +55,7 @@ ErrorOr<FlatPtr> Process::sys$statvfs(Userspace<const Syscall::SC_statvfs_params
ErrorOr<FlatPtr> Process::sys$fstatvfs(int fd, statvfs* buf)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
- REQUIRE_PROMISE(stdio);
+ require_promise(Pledge::stdio);
auto description = TRY(fds().open_file_description(fd));
auto const* inode = description->inode();