[PATCH] fallocate: pass off_t in register pair correctly for 64-bit off_t

Mike Frysinger vapier@gentoo.org
Fri Jun 24 08:30:00 GMT 2016


On 24 Jun 2016 08:43, Yury Norov wrote:
> sysdeps/unix/sysv/linux/fallocate.c contains wide-spreaded hack for creating
> register pair from 32-bit signed value:
> 	LONG_LONG_PAIR (val >> 31, val)
> 
> It works well for off_t if it is 32-bit lenght. Modern ABIs requres 64-bit off_t,
> so this hack doesn't work for them. In this patch, fallocate handler is taken from
> fallocate64.c, depending on __OFF_T_MATCHES_OFF64_T.

what ABIs exactly are you referring to ?

why is this change specific to fallocate ?  seems like this argument
could be made about any of the funcs that operate on off_t's.  what
about posix_fallocate ?  posix_fadvise ?

> The other option to fix it is to introduce macro that creates the pair correctly
> for both 32- and 64-bit off_t, like this:

if off_t & off64_t are the same size, we don't want duplicate symbols
that do the same thing.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20160624/6b69552b/attachment.sig>


More information about the Libc-alpha mailing list