This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Question regarding pwritev/preadv ports
- From: Ben <ben at wijen dot net>
- To: Mike Frysinger <vapier at gentoo dot org>
- Cc: libc-help at sourceware dot org
- Date: Thu, 10 Sep 2015 19:25:04 +0200
- Subject: Re: Question regarding pwritev/preadv ports
- Authentication-results: sourceware.org; auth=none
- References: <20150906100922 dot 1BC08340A76 at smtp dot gentoo dot org> <20150906143519 dot GA3849 at vapier>
Hi Mike,
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?)
For example:
If I am not mistaken, for some time the arm platform did have
the pwritev syscall, but still used the posix emulation.
For such a platform I want to use my own 'non-atomic' version.
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)));
I would really like to understand the 'why' of these...
Thank you,
Ben...
At 16:35 2015-09-06, Mike Frysinger wrote:
On 06 Sep 2015 12:03, Ben wrote:
> I was wondering if there is any way for an application to 'know'
> which implementation is used.
not really, by design
> The specific reason is: I want to override the posix implementation
> with a non-atomic one.
> (So just iterating over the vector until all is written.)
just define & export the symbol then in a shared library and link or
LD_PRELOAD it to interpose your version of the symbol
> Furthermore, looking at the platform specific implementations,
> they need to have the offset split into high and low value, I get that.
i wouldn't worry about trying to call the kernel directly. use dlopen
and dlsym to get the symbol of the real pwritev from libc.so and call
that one at a time on a single iovec element.
-mike