[PATCH v2] Fix p{readv,writev}{64} consolidation implementation

Mike Frysinger vapier@gentoo.org
Wed Jun 15 22:38:00 GMT 2016


On 15 Jun 2016 18:20, Adhemerval Zanella wrote:
> --- a/sysdeps/unix/sysv/linux/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/sysdep.h
> @@ -47,3 +47,12 @@
>  #define SYSCALL_LL64(val) \
>    __LONG_LONG_PAIR ((long) ((val) >> 32), (long) ((val) & 0xffffffff))
>  #endif
> +
> +/* Provide a macro to pass the off{64}_t argument on p{readv,writev}{64}.  */
> +#if __WORDSIZE == 64 || defined __ASSUME_WORDSIZE64_ILP32
> +# define LO_HI_LONG(val) (val)
> +#else
> +# define LO_HI_LONG(val) \
> +  (off_t) (val),                                                          \
> +  (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
> +#endif

does this really need to be this complicated ?  we're already making an
assumption about the size for 64-bit & 64-bit/ilp32 ports, and you're
using an uint64_t cast to start with, and SYSCALL_LL64 assumes 32.
  (long) (val),
  (long) (((uint64_t) (val)) >> 32)
-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/20160615/7eeaaf05/attachment.sig>


More information about the Libc-alpha mailing list