summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-06-01 20:31:36 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-06-01 20:31:36 +0200
commit93d3d1ede148156a2f3eedae45a4642dd27520a5 (patch)
tree1b21d59fa4419eb17966b94c8b9358defa882252 /Kernel/FileSystem
parent51581c21fca245be7677d61282fe6fc7b6e69ca1 (diff)
downloadserenity-93d3d1ede148156a2f3eedae45a4642dd27520a5.zip
Kernel: Add fchown() syscall.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/FileDescriptor.cpp7
-rw-r--r--Kernel/FileSystem/FileDescriptor.h2
2 files changed, 9 insertions, 0 deletions
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<File>&&, SocketRole = SocketRole::None);