mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:27:35 +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
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