This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/4] Consolidate pread/pread64 implementations

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]