summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2026-04-18 13:19:56 +0300
committerThomas Weißschuh <linux@weissschuh.net>2026-04-27 20:45:25 +0300
commitf38a0bb74576f418f264b8d407be8de7aac1f42a (patch)
tree9ba5d762239837152cb10cb1c0b37e5784e32761 /tools/include
parent7ffb6e99c3662322fd9ffdd4417c2aabd4af95b9 (diff)
downloadlinux-f38a0bb74576f418f264b8d407be8de7aac1f42a.tar.xz
tools/nolibc: also handle _llseek system call
On some architectures the llseek system call contains a leading underscore. Treat it the same way as llseek and prefer it over the plain lseek system call as is necessary for 64-bit offset handling. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://patch.msgid.link/20260418-nolibc-largefile-v1-1-b91f0775bac3@weissschuh.net
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/nolibc/sys.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index fd7a2ee780e8..841158eb07c3 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -611,12 +611,18 @@ int link(const char *old, const char *new)
static __attribute__((unused))
off_t _sys_lseek(int fd, off_t offset, int whence)
{
-#if defined(__NR_llseek)
+#if defined(__NR_llseek) || defined(__NR__llseek)
__kernel_loff_t loff = 0;
+ int ret, nr_llseek;
off_t result;
- int ret;
- ret = __nolibc_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset, &loff, whence);
+#if defined(__NR_llseek)
+ nr_llseek = __NR_llseek;
+#else
+ nr_llseek = __NR__llseek;
+#endif
+
+ ret = __nolibc_syscall5(nr_llseek, fd, offset >> 32, (uint32_t)offset, &loff, whence);
if (ret < 0)
result = ret;
else