summaryrefslogtreecommitdiff
path: root/Kernel/Process.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-30 23:50:31 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-30 23:50:31 +0200
commit2e2de125e5134d0fdcb6d4e96a3a025be5630811 (patch)
tree91748a0cfba22a56acbe9d66eab14a813f4dcbdf /Kernel/Process.h
parentf2a152e9304ebd8c564cb730190c6aaf232252b5 (diff)
downloadserenity-2e2de125e5134d0fdcb6d4e96a3a025be5630811.zip
Kernel: Turn Process::FileDescriptionAndFlags into a proper class
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r--Kernel/Process.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/Kernel/Process.h b/Kernel/Process.h
index 049dbc7df3..da3eee26d0 100644
--- a/Kernel/Process.h
+++ b/Kernel/Process.h
@@ -573,12 +573,22 @@ private:
static const int m_max_open_file_descriptors { FD_SETSIZE };
- struct FileDescriptionAndFlags {
- operator bool() const { return !!description; }
+ class FileDescriptionAndFlags {
+ public:
+ operator bool() const { return !!m_description; }
+
+ FileDescription* description() { return m_description; }
+ const FileDescription* description() const { return m_description; }
+
+ u32 flags() const { return m_flags; }
+ void set_flags(u32 flags) { m_flags = flags; }
+
void clear();
- void set(NonnullRefPtr<FileDescription>&& d, u32 f = 0);
- RefPtr<FileDescription> description;
- u32 flags { 0 };
+ void set(NonnullRefPtr<FileDescription>&&, u32 flags = 0);
+
+ private:
+ RefPtr<FileDescription> m_description;
+ u32 m_flags { 0 };
};
Vector<FileDescriptionAndFlags> m_fds;