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] | |
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
Attachment:
signature.asc
Description: Digital signature
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |