mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18: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:
parent
e9f2cc3595
commit
0058da734e
8 changed files with 26 additions and 8 deletions
|
@ -146,7 +146,7 @@ pid_t getpgrp()
|
|||
|
||||
int creat(const char* path, mode_t mode)
|
||||
{
|
||||
return open(path, O_CREAT, mode);
|
||||
return open(path, O_CREAT | O_WRONLY | O_TRUNC, mode);
|
||||
}
|
||||
|
||||
int open(const char* path, int options, ...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue