diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-30 23:50:31 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-30 23:50:31 +0200 |
commit | 2e2de125e5134d0fdcb6d4e96a3a025be5630811 (patch) | |
tree | 91748a0cfba22a56acbe9d66eab14a813f4dcbdf /Kernel/Process.h | |
parent | f2a152e9304ebd8c564cb730190c6aaf232252b5 (diff) | |
download | serenity-2e2de125e5134d0fdcb6d4e96a3a025be5630811.zip |
Kernel: Turn Process::FileDescriptionAndFlags into a proper class
Diffstat (limited to 'Kernel/Process.h')
-rw-r--r-- | Kernel/Process.h | 20 |
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; |