]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
tools/nolibc: prefer the llseek syscall
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 29 Oct 2025 16:02:53 +0000 (17:02 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Thu, 20 Nov 2025 18:46:52 +0000 (19:46 +0100)
Make sure to always use the 64-bit safe system call
in preparation for 64-bit off_t on 32 bit architectures.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
tools/include/nolibc/sys.h

index 2b186d1af52e30a1dccea7f4e0d2ce8cce394d8f..32815c299365f29e4d47f2b79a7624ce92ea8b9a 100644 (file)
@@ -605,9 +605,7 @@ 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_lseek)
-       return my_syscall3(__NR_lseek, fd, offset, whence);
-#else
+#if defined(__NR_llseek)
        __kernel_loff_t loff = 0;
        off_t result;
        int ret;
@@ -621,6 +619,8 @@ off_t sys_lseek(int fd, off_t offset, int whence)
                result = loff;
 
        return result;
+#else
+       return my_syscall3(__NR_lseek, fd, offset, whence);
 #endif
 }