]> Gentwo Git Trees - linux/.git/commitdiff
tools/nolibc: handle 64-bit off_t for llseek
authorThomas Weißschuh <linux@weissschuh.net>
Wed, 29 Oct 2025 16:02:52 +0000 (17:02 +0100)
committerThomas Weißschuh <linux@weissschuh.net>
Thu, 20 Nov 2025 18:46:45 +0000 (19:46 +0100)
Correctly handle 64-bit off_t values in preparation for 64-bit off_t on
32-bit architectures.

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

index fcc36cffad4db19c418b206f0556e3ab39c9a89d..2b186d1af52e30a1dccea7f4e0d2ce8cce394d8f 100644 (file)
@@ -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)