[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251029-nolibc-uapi-types-v1-3-e79de3b215d8@weissschuh.net>
Date: Wed, 29 Oct 2025 17:02:53 +0100
From: Thomas Weißschuh <linux@...ssschuh.net>
To: Willy Tarreau <w@....eu>, Shuah Khan <shuah@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org, 
 linux-kselftest@...r.kernel.org, 
 Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH 03/12] tools/nolibc: prefer the llseek syscall
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@...ssschuh.net>
---
 tools/include/nolibc/sys.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h
index 321a3bd16ff4..58cd2bb0f6ce 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -592,9 +592,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;
@@ -608,6 +606,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
 }
 
-- 
2.51.1.dirty
Powered by blists - more mailing lists
 
