From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24467 invoked by alias); 9 Nov 2016 13:44:32 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 20735 invoked by uid 89); 9 Nov 2016 13:44:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=truncate64, ftruncate, ftruncate64, __ftruncate64 X-HELO: mail-ua0-f173.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=wVTosZQdH5St2oyrGOES55/dFiX+iAuMYWRM/L09iyg=; b=YrOlnn5G3bIj8N+hMnnW0JadIoTUD2oghVrrn/d27RoGe0+Q2pNUht32YMgXsVesm4 M6uGivdiDJANo2SY4ZO38L2Jg2Kv4ifu18Stg6ZY/F68gm2/MnA1cUQQ0yynFD/OxIZR 5FdP6ePkOadBTHkyPpCFl6iECC7I2m7UrYCnTJ1JaJAMZWMd3eVtIouOtoDVlfwLpOQn 2TbVjg3rPuLUqHufWa532OKR5S4SyHBlSiXyId10Ed/EZGjHZFMHN50L5EjnBeCK+stJ FAnNSC3yVc3ye9qKsyoNjwRm2oWD8Jwlm0XJX5eNneQCh7s2Up1cuEs5Yl/R28N3rjSH 1vtg== X-Gm-Message-State: ABUngvdWoMVBvaPQUorNRoWoCW0Y042H0hNo6jwvJe14Ty8ypuMmQqwdrxO2jKpxNsialjzB X-Received: by 10.159.35.208 with SMTP id 74mr447087uao.33.1478699059874; Wed, 09 Nov 2016 05:44:19 -0800 (PST) Subject: Re: [PATCH 4/4] Consolidate Linux truncate implementations To: Yury Norov References: <1474383714-15187-1-git-send-email-adhemerval.zanella@linaro.org> <1474383714-15187-5-git-send-email-adhemerval.zanella@linaro.org> <20160922142442.GA5914@yury-N73SV> <330498bd-5430-94eb-f033-73236269be13@linaro.org> <20160922155131.GA20294@yury-N73SV> <6e461b86-63e1-0980-0b26-608cea3575a0@linaro.org> <0beb6ef6-486f-6a47-5743-94ce16c4365c@linaro.org> Cc: libc-alpha@sourceware.org From: Adhemerval Zanella Message-ID: <2e457147-ee53-7a2a-41e4-4d201b421460@linaro.org> Date: Wed, 09 Nov 2016 13:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <0beb6ef6-486f-6a47-5743-94ce16c4365c@linaro.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00333.txt.bz2 Does anyone have any objection with this patch? If no one opposes I would like to push it to avoid get in late near freeze. On 25/10/2016 15:54, Adhemerval Zanella wrote: > Ping. > > On 22/09/2016 16:04, Adhemerval Zanella wrote: >> >> >> On 22/09/2016 12:51, Yury Norov wrote: >>> On Thu, Sep 22, 2016 at 11:42:11AM -0300, Adhemerval Zanella wrote: >>>> >>>> >>>> On 22/09/2016 11:24, Yury Norov wrote: >>>>>> +/* Truncate PATH to LENGTH bytes. */ >>>>>> int >>>>>> -truncate64 (const char *path, off64_t length) >>>>>> +__truncate64 (const char *path, off64_t length) >>>>>> { >>>>>> - unsigned int low = length & 0xffffffff; >>>>>> - unsigned int high = length >> 32; >>>>>> - int result = INLINE_SYSCALL (truncate64, 3, path, >>>>>> - __LONG_LONG_PAIR (high, low)); >>>>>> - return result; >>>>>> + return INLINE_SYSCALL_CALL (truncate64, path, >>>>>> + __ALIGNMENT_ARG SYSCALL_LL64 (length)); >>>>>> } >>>>>> +weak_alias (__truncate64, truncate64) >>>>>> + >>>>>> +#ifdef __OFF_T_MATCHES_OFF64_T >>>>>> +weak_alias (__truncate64, truncate); >>>>>> +#endif >>>>> >>>>> It seems you forgot weak_alias (__truncate64, __truncate); >>>>> >>>> >>>> I do not think it requires to add __truncate alias since glibc currently >>>> does have internal calls to truncate. >>> >>> Sorry, I was meaning __ftruncate: >>> /home/yury/work/toolchain/build-glibc-aarch64-thunderx-linux-gnu-mabi-ilp32/libc_pic.os: >>> In function `internal_fallocate': >>> /home/yury/work/toolchain/gits/glibc/io/../sysdeps/posix/posix_fallocate.c:64: >>> undefined reference to `__ftruncate' >>> >>> Truncate looks correct. >>> The fix is like this to me: >>> >>> -- >>> diff --git a/sysdeps/unix/sysv/linux/ftruncate64.c b/sysdeps/unix/sysv/linux/ftruncate64.c >>> index 914ce67..4a00db5 100644 >>> --- a/sysdeps/unix/sysv/linux/ftruncate64.c >>> +++ b/sysdeps/unix/sysv/linux/ftruncate64.c >>> @@ -33,5 +33,6 @@ __ftruncate64 (int fd, off64_t length) >>> weak_alias (__ftruncate64, ftruncate64) >>> >>> #ifdef __OFF_T_MATCHES_OFF64_T >>> +weak_alias (__ftruncate64, __ftruncate) >>> weak_alias (__ftruncate64, ftruncate); >>> #endif >>> >> >> Ah right, the fallback posix_fallocate implementation. I will add this to >> the patch, thanks. >>