This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/3] network: recvmsg and sendmsg standard compliance (BZ#16919)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Zack Weinberg <zackw at panix dot com>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, GNU C Library <libc-alpha at sourceware dot org>, Florian Weimer <fweimer at redhat dot com>
- Date: Fri, 10 Jun 2016 20:17:34 +0000
- Subject: Re: [PATCH 2/3] network: recvmsg and sendmsg standard compliance (BZ#16919)
- Authentication-results: sourceware.org; auth=none
- References: <1459175641-12520-1-git-send-email-adhemerval dot zanella at linaro dot org> <1459175641-12520-3-git-send-email-adhemerval dot zanella at linaro dot org> <a963950f-bb21-be79-bddd-8379b588378a at panix dot com> <5756D873 dot 1000701 at linaro dot org> <CAKCAbMgk7vtMFoXKJ45TwnFv7gqNesNk0AuSRHvg58XMSMaQTg at mail dot gmail dot com> <575886C8 dot 8000401 at linaro dot org> <5758DFF7 dot 5020800 at redhat dot com> <CAKCAbMj_UP4Dpidn5nJ1xnZY0KK3KYkHiWgmTXrcQT+bNKjJBQ at mail dot gmail dot com> <4ce169ed-9dc2-9bcd-e66d-7443b371befa at redhat dot com> <alpine dot DEB dot 2 dot 20 dot 1606101817020 dot 12325 at digraph dot polyomino dot org dot uk> <4802db36-be1f-488c-39b6-bdb9198df625 at redhat dot com>
On Fri, 10 Jun 2016, Carlos O'Donell wrote:
> > For gettid I think the actual issue is difficulty in establishing
> > consensus in the absence of unanimity. That's caused issues for all of:
> > gettid / pthread_gettid_np, explicit_bzero, strlcpy / strlcat, Linux
> > syscall wrappers in general especially where not appropriate for the
> > OS-independent GNU API. (I think all of those are appropriate for
> > inclusion in glibc.)
>
> The OS-independent GNU API is in my mind an issue of documentation,
> describing which APIs are Linux-specific and which are not.
There were objections from Roland and Mike at least to adding
Linux-specific APIs to libc.so.
Now, I disagree with the proposal for libinux-syscalls.so:
* Because of thread cancellation (something that needs considering for
each syscall wrapper, along with errno and the choice of types),
libinux-syscalls.so would be closely tied to a particular libc version, so
you can't readily keep around copies from multiple libc versions.
* Thus, removing any interfaces from it to add them to libc.so would be
problematic, because glibc would need to install multiple versions of
libinux-syscalls.so.
* We cannot readily tell when adding an interface whether it would remain
Linux-specific or be adopted by other OSes in future, and so whether it
belongs in the OS-independent GNU API or not. So we cannot tell when
adding an interface which library it belongs in. So we'd be likely
repeatedly to add interfaces to libinux-syscalls.so and then add them to
libc.so as well, accumulating compat duplicates in libinux-syscalls.so.
But it's not clear there's consensus on adding syscall wrappers to
libc.so, and there certainly isn't unanimity.
> I would be happy to see gettid implemented as a wrapper if someone
> would step up to document exactly how it behaves and where it is valid
> to use the resulting return value and in what APIs. That I think is
> where everyone balks at the work.
I think the answer is that the return value may be used with syscalls that
take tids (which are legimitate interfaces for glibc users to use, in most
cases), some of which may have matching glibc interfaces and some of which
may not. While we should describe what wrappers do in the glibc manual,
ultimately for Linux-specific syscall wrappers the kernel's behavior is
more authoritative than the manual.
--
Joseph S. Myers
joseph@codesourcery.com