This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/4] Consolidate off_t/off64_t syscall argument passing
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 4 Jan 2016 10:33:30 -0200
- Subject: Re: [PATCH 2/4] Consolidate off_t/off64_t syscall argument passing
- Authentication-results: sourceware.org; auth=none
- References: <1447855356-4140-1-git-send-email-adhemerval dot zanella at linaro dot org> <1447855356-4140-3-git-send-email-adhemerval dot zanella at linaro dot org> <20151229172408 dot GN25803 at vapier dot lan>
On 29-12-2015 15:24, Mike Frysinger wrote:
> On 18 Nov 2015 12:02, Adhemerval Zanella wrote:
>> This patch add two new macros to use along with off_t and off64_t argument
>> syscalls. The rationale for this change is:
>>
>> 1. Remove multiple implementations for the same syscall for different
>> architectures (for instance, pread have 6 different implementations).
>>
>> 2. Also remove the requirement to use syscall wrappers for cancellable
>> entrypoints.
>>
>> The macro usage should be used along __ALIGNMENT_ARG to follow ABI constrains
>> for architecture where it applies. For instance, pread can be rewritten as:
>>
>> return SYSCALL_CANCEL (pread, fd, buf, count,
>> __ALIGNMENT_ARG SYSCALL_LL (offset));
>>
>> Another macro, SYSCALL_LL64, is provided for off64_t.
>>
>> The changes itself are not currently used in any implementation, so no
>> code change is expected.
>
> a quick scan looks like you're doing this purely along 32-bit/64-bit lines.
> why not add the 32-bit definition to sysdeps/unix/sysv/linux/sysdep.h and
> the 64-bit definition to sysdeps/unix/sysv/linux/wordsize-64/sysdep.h ?
>
> sysdeps/unix/sysv/linux/sysdep.h:
> #ifndef SYSCALL_LL
> # define SYSCALL_LL ...
> #endif
>
> sysdeps/unix/sysv/linux/wordsize-64/sysdep.h:
> #define SYSCALL_LL ...
> #include <sysdeps/unix/sysv/linux/sysdep.h>
>
> you would have to update all the 64-bit arches to pull in the wordsize-64
> header since it looks like sysdep.h has a lot of direct includes rather
> than stacking & using include_next.
> -mike
>
I think it can be done, however I would like to avoid creating and setting
the 64-bit arches to use the new header disassociated if the arch actually
use the wordsize-64 implementation (I see this to be a follow up cleanup).