From patchwork Fri Apr 13 08:24:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Ren X-Patchwork-Id: 897882 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=uclibc-ng.org (client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-sky.com Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40MrRp1QCXz9s27 for ; Fri, 13 Apr 2018 18:24:54 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 15E3A10117; Fri, 13 Apr 2018 10:24:50 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from smtp2200-217.mail.aliyun.com (smtp2200-217.mail.aliyun.com [121.197.200.217]) by helium.openadk.org (Postfix) with ESMTPS id 75C6D100E9; Fri, 13 Apr 2018 10:24:47 +0200 (CEST) X-Alimail-AntiSpam: AC=CONTINUE; BC=0.07892336|-1; CH=green; FP=0|0|0|0|0|-1|-1|-1; HT=e02c03306; MF=ren_guo@c-sky.com; NM=1; PH=DS; RN=3; RT=3; SR=0; TI=SMTPD_---.BfwwqpQ_1523607882; Received: from localhost(mailfrom:ren_guo@c-sky.com fp:SMTPD_---.BfwwqpQ_1523607882) by smtp.aliyun-inc.com(10.147.41.199); Fri, 13 Apr 2018 16:24:42 +0800 From: Guo Ren To: devel@uclibc-ng.org, wbx@uclibc-ng.org Date: Fri, 13 Apr 2018 16:24:41 +0800 Message-Id: <1523607881-28837-1-git-send-email-ren_guo@c-sky.com> X-Mailer: git-send-email 2.7.4 Cc: Guo Ren Subject: [uclibc-ng-devel] [PATCH] lseek.c: bugfix ltp lseek01.c X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" 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(-) diff --git a/libc/sysdeps/linux/common/lseek.c b/libc/sysdeps/linux/common/lseek.c index 33df822..80d6931 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