mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Kernel+LibC+LibCore: Pass fcntl extra argument as pointer-sized variable
The extra argument to fcntl is a pointer in the case of F_GETLK/F_SETLK and we were pulling out a u32, leading to pointer truncation on x86_64. Among other things, this fixes Assistant on x86_64 :^)
This commit is contained in:
parent
656528f483
commit
d728017578
4 changed files with 4 additions and 4 deletions
|
@ -349,7 +349,7 @@ public:
|
|||
ErrorOr<FlatPtr> sys$setresgid(GroupID, GroupID, GroupID);
|
||||
ErrorOr<FlatPtr> sys$alarm(unsigned seconds);
|
||||
ErrorOr<FlatPtr> sys$access(Userspace<char const*> pathname, size_t path_length, int mode);
|
||||
ErrorOr<FlatPtr> sys$fcntl(int fd, int cmd, u32 extra_arg);
|
||||
ErrorOr<FlatPtr> sys$fcntl(int fd, int cmd, uintptr_t extra_arg);
|
||||
ErrorOr<FlatPtr> sys$ioctl(int fd, unsigned request, FlatPtr arg);
|
||||
ErrorOr<FlatPtr> sys$mkdir(Userspace<char const*> pathname, size_t path_length, mode_t mode);
|
||||
ErrorOr<FlatPtr> sys$times(Userspace<tms*>);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
ErrorOr<FlatPtr> Process::sys$fcntl(int fd, int cmd, u32 arg)
|
||||
ErrorOr<FlatPtr> Process::sys$fcntl(int fd, int cmd, uintptr_t arg)
|
||||
{
|
||||
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
|
||||
TRY(require_promise(Pledge::stdio));
|
||||
|
|
|
@ -19,7 +19,7 @@ int fcntl(int fd, int cmd, ...)
|
|||
{
|
||||
va_list ap;
|
||||
va_start(ap, cmd);
|
||||
u32 extra_arg = va_arg(ap, u32);
|
||||
uintptr_t extra_arg = va_arg(ap, uintptr_t);
|
||||
int rc = syscall(SC_fcntl, fd, cmd, extra_arg);
|
||||
va_end(ap);
|
||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||
|
|
|
@ -248,7 +248,7 @@ ErrorOr<int> fcntl(int fd, int command, ...)
|
|||
{
|
||||
va_list ap;
|
||||
va_start(ap, command);
|
||||
u32 extra_arg = va_arg(ap, u32);
|
||||
uintptr_t extra_arg = va_arg(ap, uintptr_t);
|
||||
int rc = ::fcntl(fd, command, extra_arg);
|
||||
va_end(ap);
|
||||
if (rc < 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue