1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00

Kernel: Add Inode::truncate(size).

- Use this to implement the O_TRUNC open flag.
- Fix creat() to pass O_CREAT | O_TRUNC | O_WRONLY.
- Make sure we truncate wherever appropriate.
This commit is contained in:
Andreas Kling 2019-03-27 16:42:30 +01:00
parent e9f2cc3595
commit 0058da734e
8 changed files with 26 additions and 8 deletions

View file

@ -103,6 +103,7 @@ public:
virtual size_t directory_entry_count() const = 0;
virtual KResult chmod(mode_t) = 0;
virtual KResult chown(uid_t, gid_t) = 0;
virtual KResult truncate(int) { return KSuccess; }
LocalSocket* socket() { return m_socket.ptr(); }
const LocalSocket* socket() const { return m_socket.ptr(); }