This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] generic/wordsize-32: don't duplicate truncate syscalls if not needed
- From: Yury Norov <ynorov at caviumnetworks dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 20 Sep 2016 16:43:49 +0300
- Subject: Re: [PATCH] generic/wordsize-32: don't duplicate truncate syscalls if not needed
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Yuri dot Norov at caviumnetworks dot com;
- References: <1474318609-18149-1-git-send-email-ynorov@caviumnetworks.com> <fdf577bc-43ed-555e-b5f1-3da0978d346f@linaro.org>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
On Tue, Sep 20, 2016 at 10:04:12AM -0300, Adhemerval Zanella wrote:
>
>
> On 19/09/2016 17:56, Yury Norov wrote:
> > If off_t is 64-bit, current implementation of truncate() and ftruncate()
> > is wrong, and proper implementation is identical to corresponding 64-bit
> > versions of syscalls. This patch creates aliases for it.
>
> I think we can try to go forward and consolidate both all truncate and
> ftruncate implementation on Linux. I sent a patchset last month [1] [2]
> and I will send an update today with some small fixes. I think it should
> work on aarch64 ilp32 as well, it uses the logic for:
>
> {f}truncate.c:
>
> #ifndef __OFF_T_MATCHES_OFF64_T
> __{f}truncate (..., off_t length)
> {
> # ifndef __NR_ftruncate
> return INLINE_SYSCALL_CALL (ftruncate64, ...,
> __ALIGNMENT_ARG SYSCALL_LL (length));
> # else
> return INLINE_SYSCALL_CALL (ftruncate, ..., length);
> # endif
> }
> weak_alias (__ftruncate, ftruncate)
> #endif
>
>
> {f}truncate64.c:
>
> #ifndef __NR_ftruncate64
> # define __NR_ftruncate64 __NR_ftruncate
> #endif
>
> int
> __{f}truncate64 (..., off_t length)
> {
> return INLINE_SYSCALL_CALL (ftruncate64, ...,
> __ALIGNMENT_ARG SYSCALL_LL64 (length));
> }
> weak_alias (__ftruncate64, ftruncate64)
>
> #ifdef __OFF_T_MATCHES_OFF64_T
> weak_alias (__ftruncate64, ftruncate);
> #endif
>
>
> [1] https://sourceware.org/ml/libc-alpha/2016-08/msg00811.html
> [2] https://sourceware.org/ml/libc-alpha/2016-08/msg00812.html
OK, looks good. I'll replace my patch with your version when you update it.
Could you also comment my patches on stat and getdents()?
https://sourceware.org/ml/libc-alpha/2016-09/msg00315.html
https://sourceware.org/ml/libc-alpha/2016-09/msg00240.html
Yury.