Correctly handle 64-bit off_t values in preparation for 64-bit off_t on
32-bit architectures.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
 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 386ed80aead0..321a3bd16ff4 100644
--- a/tools/include/nolibc/sys.h
+++ b/tools/include/nolibc/sys.h
@@ -599,8 +599,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.51.1.dirty


Reply via email to