From 93d3d1ede148156a2f3eedae45a4642dd27520a5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 1 Jun 2019 20:31:36 +0200 Subject: Kernel: Add fchown() syscall. --- Kernel/FileSystem/FileDescriptor.cpp | 7 +++++++ Kernel/FileSystem/FileDescriptor.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'Kernel/FileSystem') diff --git a/Kernel/FileSystem/FileDescriptor.cpp b/Kernel/FileSystem/FileDescriptor.cpp index f7e7a36027..0fb1f71b9f 100644 --- a/Kernel/FileSystem/FileDescriptor.cpp +++ b/Kernel/FileSystem/FileDescriptor.cpp @@ -324,3 +324,10 @@ void FileDescriptor::set_file_flags(dword flags) m_should_append = flags & O_APPEND; m_file_flags = flags; } + +KResult FileDescriptor::chown(uid_t uid, gid_t gid) +{ + if (!m_inode) + return KResult(-EINVAL); + return m_inode->chown(uid, gid); +} diff --git a/Kernel/FileSystem/FileDescriptor.h b/Kernel/FileSystem/FileDescriptor.h index d95ceb6456..7d8cdf8d7d 100644 --- a/Kernel/FileSystem/FileDescriptor.h +++ b/Kernel/FileSystem/FileDescriptor.h @@ -101,6 +101,8 @@ public: off_t offset() const { return m_current_offset; } + KResult chown(uid_t, gid_t); + private: friend class VFS; FileDescriptor(RetainPtr&&, SocketRole = SocketRole::None); -- cgit v1.2.3