From d93d0593dd65b8cd72d6dc9bda7fc4982fd65afb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 29 Oct 2025 17:02:52 +0100 Subject: [PATCH] tools/nolibc: handle 64-bit off_t for llseek MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Correctly handle 64-bit off_t values in preparation for 64-bit off_t on 32-bit architectures. Signed-off-by: Thomas Weißschuh Acked-by: Arnd Bergmann Acked-by: Willy Tarreau --- tools/include/nolibc/sys.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/include/nolibc/sys.h b/tools/include/nolibc/sys.h index fcc36cffad4db..2b186d1af52e3 100644 --- a/tools/include/nolibc/sys.h +++ b/tools/include/nolibc/sys.h @@ -612,8 +612,7 @@ off_t sys_lseek(int fd, off_t offset, int whence) off_t result; int ret; - /* Only exists on 32bit where nolibc off_t is also 32bit */ - ret = my_syscall5(__NR_llseek, fd, 0, offset, &loff, whence); + ret = my_syscall5(__NR_llseek, fd, offset >> 32, (uint32_t)offset, &loff, whence); if (ret < 0) result = ret; else if (loff != (off_t)loff) -- 2.47.3