[libc-commits] [PATCH] D129963: [libc] use correct syscall define for SYS__llseek
Joost Heitbrink via Phabricator via libc-commits
libc-commits at lists.llvm.org
Sun Jul 17 04:30:11 PDT 2022
gytsen created this revision.
gytsen added reviewers: michaelrj, sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
gytsen requested review of this revision.
Prior to this revision, the preprocessor would correctly look for the
definition of SYS__llseek. However, the resulting call to syscall(2)
would be done in this branch using SYS__lseek.
Fix this by calling syscall(2) using SYS__llseek.
fixes #56122 <https://github.com/llvm/llvm-project/issues/56122>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D129963
Files:
libc/src/__support/File/linux_file.cpp
Index: libc/src/__support/File/linux_file.cpp
===================================================================
--- libc/src/__support/File/linux_file.cpp
+++ libc/src/__support/File/linux_file.cpp
@@ -77,7 +77,7 @@
long ret = __llvm_libc::syscall(SYS_lseek, lf->get_fd(), offset, whence);
#elif defined(SYS__llseek)
long result;
- long ret = __llvm_libc::syscall(SYS__lseek, lf->get_fd(), offset >> 32,
+ long ret = __llvm_libc::syscall(SYS__llseek, lf->get_fd(), offset >> 32,
offset, &result, whence);
#else
#error "lseek and _llseek syscalls not available to perform a seek operation."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129963.445313.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220717/dd79568c/attachment.bin>
More information about the libc-commits
mailing list