diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-26 01:18:04 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-26 01:32:05 +0200 |
commit | c6e79bd53a37aa0d9fb7c610d7d251a9e1b0a11d (patch) | |
tree | e77ed0234988035b4f1df9038cf190c94d6b4cdd /Kernel/FileSystem | |
parent | 90dbf689c006f3335aaec1129d01f1f921e2122c (diff) | |
download | serenity-c6e79bd53a37aa0d9fb7c610d7d251a9e1b0a11d.zip |
Kernel: Support O_APPEND
As per the manpage, this acts as a transparent lseek() before write.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r-- | Kernel/FileSystem/FileDescriptor.cpp | 1 | ||||
-rw-r--r-- | Kernel/FileSystem/FileDescriptor.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Kernel/FileSystem/FileDescriptor.cpp b/Kernel/FileSystem/FileDescriptor.cpp index b158fb6eb0..e199fdd298 100644 --- a/Kernel/FileSystem/FileDescriptor.cpp +++ b/Kernel/FileSystem/FileDescriptor.cpp @@ -75,6 +75,7 @@ Retained<FileDescriptor> FileDescriptor::clone() ASSERT(descriptor); descriptor->m_current_offset = m_current_offset; descriptor->m_is_blocking = m_is_blocking; + descriptor->m_should_append = m_should_append; descriptor->m_file_flags = m_file_flags; return *descriptor; } diff --git a/Kernel/FileSystem/FileDescriptor.h b/Kernel/FileSystem/FileDescriptor.h index 98631ce0ba..2f9b98c42b 100644 --- a/Kernel/FileSystem/FileDescriptor.h +++ b/Kernel/FileSystem/FileDescriptor.h @@ -70,6 +70,8 @@ public: bool is_blocking() const { return m_is_blocking; } void set_blocking(bool b) { m_is_blocking = b; } + bool should_append() const { return m_should_append; } + void set_should_append(bool s) { m_should_append = s; } dword file_flags() const { return m_file_flags; } void set_file_flags(dword flags) { m_file_flags = flags; } @@ -113,6 +115,7 @@ private: dword m_file_flags { 0 }; bool m_is_blocking { true }; + bool m_should_append { false }; SocketRole m_socket_role { SocketRole::None }; FIFO::Direction m_fifo_direction { FIFO::Direction::Neither }; }; |