Question regarding pwritev/preadv ports

Mike Frysinger
Sun Sep 13 01:05:00 GMT 2015

On 10 Sep 2015 19:25, Ben wrote:
> Let me rephrase:
> Given the set of all platforms libc supports,
> I would like to know for which platforms the posix emulation is used?
> And for bonus: Which of these do have __NR_pwritev? (So pwritev as syscall?)

there is really no info like this exported by the runtime library

> Furthermore:
> I simple don't understand why there are 3 different implementations:
> 1: (off_t) ((((uint64_t) (val)) >> (sizeof (long) * 4)) >> (sizeof (long) * 4))
> 2: __LONG_LONG_PAIR (offset >> 31, offset));
> 3: __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff)));

you have to look at the types and syscall ABI.  pread takes a 32bit/off_t,
so shifting by 31bits is a sign extension.  pread64 takes a 64bit/off64_t,
so it gets split into upper & lower 32bit parts.

the first one is used to share code between the preadv.c & preadv64.c
implementations.  it makes things a bit messy.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <>

More information about the Libc-help mailing list