This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH RFC] Add support for linux memfd_create syscall
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, David Herrmann <dh dot herrmann at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 14 Jan 2015 17:19:24 +0000
- Subject: Re: [PATCH RFC] Add support for linux memfd_create syscall
- Authentication-results: sourceware.org; auth=none
- References: <1413537694-30556-1-git-send-email-dh dot herrmann at gmail dot com> <546F808C dot 1070801 at redhat dot com> <CALxWeYrDpRb7iczk-yM5E09y3VbR_aXfZBxBSmf7O3Unokxabg at mail dot gmail dot com> <54AFE85E dot 3050903 at redhat dot com> <CAKgNAkgfXo_eazgJEpObc9aYZVdCreVmX+a9Stra-c=BmYTJ8w at mail dot gmail dot com> <54AFFF20 dot 4010400 at redhat dot com> <CAKgNAkgpT9CCS3et8W82pNrNsvUKpPSdef6UPSPF6e=GbtRYhg at mail dot gmail dot com>
On Wed, 14 Jan 2015, Michael Kerrisk (man-pages) wrote:
> But, to take the larger point a little further. For system calls such
> as memfd_create(), presumably the most that that glibc is going to do
> is supply a wrapper and a header file with some declarations and
> constants. Does the glibc project then really want to get into the
> business of maintaining documentation for another project's APIs?
The first question is: does glibc want to get into the business of
exporting interfaces for another project's APIs (and to what extent)?
What I suggested (and Carlos put at
<https://sourceware.org/glibc/wiki/Consensus#WIP:_Kernel_syscalls_wrappers>)
about adding syscall wrappers by default accords with historic practice,
but there were objections at
<https://sourceware.org/ml/libc-alpha/2014-10/msg00591.html>. I don't
believe we have reached consensus on when it should be considered useful
to add an API of the form "call this Linux kernel syscall" (where the only
glibc choices relate to such things as thread cancellation), as opposed to
an OS-independent API (considered to be generally useful as part of the
glibc API on all systems, even if any underlying kernel has chosen a
different interface to similar functionality) that might initially be
implemented only for systems using the Linux kernel.
(Given such consensus, it would then be very useful for someone to review
Linux kernel syscalls - at least those that are architecture-independent -
to identify cases that, according to such consensus, should have
interfaces in glibc, and then to send patches implementing such
interfaces. Some syscalls already have bugs in Bugzilla requesting such
interfaces: bug 6399 for gettid, bug 9712 for futex, bug 17252 for
getrandom (a clear case for having an OS-independent interface, possibly
in addition to a direct syscall interface), bug 17662 for renameat2. But
missing interfaces for one syscall does not of course block adding them
for another, if that other syscall meets the relevant consensus.)
If an interface is exported, I think there must be a testcase - even if it
does nothing useful on execution (and it may not be able to do anything
useful on execution on old kernels, at least), it will at least make sure
that calls to the function compile and link (we've had problems before
with functions missing on some architectures). See
<https://sourceware.org/ml/libc-alpha/2013-07/msg00386.html> for a list of
untested symbols (maybe a bit out of date, but I expect the vast bulk are
still untested) - contributions of tests for existing untested symbols are
welcome.
--
Joseph S. Myers
joseph@codesourcery.com