This is the mail archive of the libc-alpha@sourceware.org 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 Fri, 8 Jan 2016, Adhemerval Zanella wrote:

> Ok I got a better solution to avoid code build duplication. The only
> issue is for mips64 n32, sizeof(off_t) is different than sizeof(off64_t)
> which leaded to continue provide a mips pread implementation (although
> as for sh is uses de default one).

To be clear: that separate n32 implementation should only be needed 
because pread and pread64 have incompatible types (without some #define 
hacks to hide one of the header declarations).  The pread64 implementation 
(defined to take a 64-bit function argument) should be usable for pread as 
well, because both 32-bit and 64-bit arguments are passed in a single 
register, and 32-bit integer arguments are always sign-extended to 64-bit 
(even if of an unsigned type) when passed in registers.  (It would have to 
be that way round; a pread implementation would not be safe to use for 
pread64 in case the compiler generated code that assumed the register had 
a 32-bit off_t value.)

-- 
Joseph S. Myers
joseph@codesourcery.com


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