Browse Source

lseek.c: bugfix ltp lseek01.c

Ref the implement from the glibc and high=0 seems so bad.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Guo Ren 6 years ago
parent
commit
ad6c75c471
1 changed files with 3 additions and 2 deletions
  1. 3 2
      libc/sysdeps/linux/common/lseek.c

+ 3 - 2
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