This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 3/4] Consolidate pread/pread64 implementations
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot com>
- Date: Tue, 23 Feb 2016 17:57:11 +0000
- Subject: Re: [PATCH 3/4] Consolidate pread/pread64 implementations
- Authentication-results: sourceware.org; auth=none
- References: <1456240627-18774-1-git-send-email-adhemerval dot zanella at linaro dot org> <1456240627-18774-4-git-send-email-adhemerval dot zanella at linaro dot org>
On Tue, 23 Feb 2016, Adhemerval Zanella wrote:
> +/* The n32 have sizeof(off_t) != sizeof(off64_t) so we can't strong/weak
> + alias the pread to pread64. We undefine the __ASSUME_WORDSIZE64_ILP32
> + so two implementation are built. */
> +#if _MIPS_SIM == _ABIN32
> +# undef __ASSUME_WORDSIZE64_ILP32
> #endif
I don't see how this will work, since you still need 64-bit arguments
passed in a single register, and __ASSUME_WORDSIZE64_ILP32 controls
SYSCALL_LL* in your patch.
Also, you're including sysdeps/unix/sysv/linux/generic/sysdep.h for
architectures that don't use the generic ABI. If that's safe, that
suggests it should just be merged into sysdeps/unix/sysv/linux/sysdep.h
(in a separate patch with a careful argument for why the merge is safe)
rather than keeping the headers separate.
The n32 ABI is that 32-bit arguments must be sign-extended to 64-bit when
passed in registers (even if the arguments are of an unsigned type). So I
think it should be safe for pread to be aliased to pread64 for n32 (it
does have to be that way round, the function being defined with the 64-bit
argument type) - though aliasing functions with incompatible C types may
be tricky.
--
Joseph S. Myers
joseph@codesourcery.com