mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-16 15:30:09 +00:00
Kernel: Make sys${ftruncate,pread} take off_t as const pointer
These syscalls don't write back to the off_t value (unlike sys$lseek) so let's take Userspace<off_t const*> instead of Userspace<off_t*>.
This commit is contained in:
parent
9c7659306a
commit
39d9337db5
Notes:
sideshowbarker
2024-07-17 22:40:15 +09:00
Author: https://github.com/awesomekling
Commit: 39d9337db5
3 changed files with 6 additions and 8 deletions
|
@ -9,12 +9,11 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<FlatPtr> Process::sys$ftruncate(int fd, Userspace<off_t*> userspace_length)
|
||||
ErrorOr<FlatPtr> Process::sys$ftruncate(int fd, Userspace<off_t const*> userspace_length)
|
||||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
|
||||
REQUIRE_PROMISE(stdio);
|
||||
off_t length;
|
||||
TRY(copy_from_user(&length, userspace_length));
|
||||
auto length = TRY(copy_typed_from_user(userspace_length));
|
||||
if (length < 0)
|
||||
return EINVAL;
|
||||
auto description = TRY(fds().open_file_description(fd));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue