From ad6c75c4710c9366f284dace3fc600346b70c9cb Mon Sep 17 00:00:00 2001 From: Guo Ren Date: Fri, 13 Apr 2018 16:24:41 +0800 Subject: lseek.c: bugfix ltp lseek01.c Ref the implement from the glibc and high=0 seems so bad. Signed-off-by: Guo Ren --- libc/sysdeps/linux/common/lseek.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libc/sysdeps/linux/common') diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c index 33df822bd..80d69318a 100644 --- a/libc/sysdeps/linux/common/lseek.c +++ b/libc/sysdeps/linux/common/lseek.c @@ -19,8 +19,9 @@ off_t __NC(lseek)(int fd, off_t offset, int whence) { #if __WORDSIZE == 32 __off64_t result; - __off_t high = 0; - return INLINE_SYSCALL(llseek, 5, fd, high, offset, &result, whence) ?: result; + return INLINE_SYSCALL(llseek, 5, fd, + (long) (((uint64_t) (offset)) >> 32), + (long) offset, &result, whence) ?: result; #else return lseek64(fd, offset, whence); #endif -- cgit v1.2.3