mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
Kernel: More work towards POSIX SHM, also add ftruncate().
This commit is contained in:
parent
99f3cc26c3
commit
26a06f3fcd
Notes:
sideshowbarker
2024-07-19 14:47:23 +09:00
Author: https://github.com/awesomekling
Commit: 26a06f3fcd
10 changed files with 92 additions and 1 deletions
|
@ -2468,3 +2468,14 @@ int Process::sys$shm_unlink(const char* name)
|
|||
return -EFAULT;
|
||||
return -ENOTIMPL;
|
||||
}
|
||||
|
||||
int Process::sys$ftruncate(int fd, off_t length)
|
||||
{
|
||||
auto* descriptor = file_descriptor(fd);
|
||||
if (!descriptor)
|
||||
return -EBADF;
|
||||
// FIXME: Check that fd is writable, otherwise EINVAL.
|
||||
if (!descriptor->is_file() && !descriptor->is_shared_memory())
|
||||
return -EINVAL;
|
||||
return descriptor->truncate(length);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue