Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>

+3 -3
+3 -3
tools/include/nolibc/sys.h
··· 605 605 static __attribute__((unused)) 606 606 off_t sys_lseek(int fd, off_t offset, int whence) 607 607 { 608 - #if defined(__NR_lseek) 609 - return my_syscall3(__NR_lseek, fd, offset, whence); 610 - #else 608 + #if defined(__NR_llseek) 611 609 __kernel_loff_t loff = 0; 612 610 off_t result; 613 611 int ret; ··· 619 621 result = loff; 620 622 621 623 return result; 624 + #else 625 + return my_syscall3(__NR_lseek, fd, offset, whence); 622 626 #endif 623 627 } 624 628