diff options
author | gggggg-gggggg <88845056+gggggg-gggggg@users.noreply.github.com> | 2022-07-03 01:02:45 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-10 20:09:11 +0200 |
commit | d728017578c18ebcf6af9a6da8182ee15a597f75 (patch) | |
tree | 1610890afdd5e0809c984374c7256e0463dfa14d /Userland/Libraries | |
parent | 656528f483f6d6bda3d17f035f5690b18b960f2a (diff) | |
download | serenity-d728017578c18ebcf6af9a6da8182ee15a597f75.zip |
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 :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibC/fcntl.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibCore/System.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibC/fcntl.cpp b/Userland/Libraries/LibC/fcntl.cpp index 4a421178d0..e67a82d357 100644 --- a/Userland/Libraries/LibC/fcntl.cpp +++ b/Userland/Libraries/LibC/fcntl.cpp @@ -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); diff --git a/Userland/Libraries/LibCore/System.cpp b/Userland/Libraries/LibCore/System.cpp index ea5ac7215c..bf48e871a8 100644 --- a/Userland/Libraries/LibCore/System.cpp +++ b/Userland/Libraries/LibCore/System.cpp @@ -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) |