All of lore.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Florian Weimer <fweimer@redhat.com>
Cc: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>,
	Daniel Colascione <dancol@google.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Joel Fernandes <joelaf@google.com>,
	Linux API <linux-api@vger.kernel.org>,
	Vlastimil Babka <vbabka@suse.cz>,
	"Carlos O'Donell" <carlos@redhat.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>
Subject: Re: Official Linux system wrapper library?
Date: Sun, 11 Nov 2018 13:09:10 +0100	[thread overview]
Message-ID: <20181111120910.GA4425@1wt.eu> (raw)
In-Reply-To: <87zhufvntw.fsf@oldenburg.str.redhat.com>

On Sun, Nov 11, 2018 at 12:46:35PM +0100, Florian Weimer wrote:
> > In practice we all know (believe?) that both statements above are
> > true but in practice 99% of the time there's a 1:1 relation between
> > these two components.
> 
> Eh.  Most Linux systems do not run glibc at all (and use cryptography
> and other tricks to prevent users from installing it).

Good point on this one. I could even have thought that most syscalls
are added with glibc in mind but your counter-example above could
remain valid.

> > What we'd really need would be to have the libc
> > interface as part of the operating system itself. I'm perfectly fine
> > with glibc providing all the "high-level" stuff like strcpy(), FILE*
> > operations etc, and all this probably is mostly system-independent.
> 
> That's a bit messy, unfortunately.
> 
> The kernel does not know about TCB layout, so a lot of low-level
> threading aspects are defined by userspace.
> 
> The kernel does not know about POSIX cancellation.  Directly calling
> system calls breaks support for that.
> 
> A lot of multi-threaded applications assume that most high-level
> functionality remains usable even after fork in a multi-threaded
> process.  (This is increasingly a problem today with all those direct
> calls to clone.)  Unfortunately, this introduces rather tricky
> low-level/high-level cross-subsystem issues, too.

But don't you think that moving a bit of this into the kernel
repository could improve the situation ? The corner cases could then
be detected when the feature is developed and be addressed either by
adapting the kernel side of the syscall or even by changing the design
before it's committed. Maybe a few extra syscalls are missing to
retrieve some critial info that would make things more reliable or
easier between userland and kernel, and that would become more obvious
with all the relevant parts at the same place ?

> > But the system interface could possibly be handled easier in the
> > system itself, which would also provide a smoother adoption of new
> > syscalls and API updates. It would also limit the hassle required to
> > provide new syscalls, as if you start to have to contribute to two
> > projects at once for a single syscall, it becomes really painful.
> 
> Sure, the duplication is unfortunate.
> 
> Several glibc contributors deeply care about standards compliance for
> header files.

For having suffered a lot from the libc-4 to libc-5 then libc-5 to glibc,
I certainly can understand their concerns about standards compliance.

> The kernel developers care not, and the result is that we
> copy definitions and declarations from the kernel header files, creating
> additional problems.

Probably that these standard compatibility issues should be addressed at
their root in the kernel header definitions in fact. Working around issues
always leads to a stall at some point, and it encourages the process not
to change.

> We also want to use old kernel headers to compile glibc and still
> implement features which are only defined by newer (upstream) kernels,
> so that leads to more duplication.

This one could possibly be got rid of. When I build glibc, I specify the
oldest supported kernel, which usually is older than or equal to the
headers used to build, but I don't expect that newer features will
magically work at all. Thus I normally build with the most recent
headers covering my needs.

Thanks,
Willy

  reply	other threads:[~2018-11-11 12:09 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-10 18:52 Official Linux system wrapper library? Daniel Colascione
2018-11-10 19:01 ` Willy Tarreau
2018-11-10 19:06   ` Daniel Colascione
2018-11-10 19:33     ` Willy Tarreau
2018-11-10 19:20 ` Greg KH
2018-11-10 19:58   ` Vlastimil Babka
2018-11-12  2:03     ` Carlos O'Donell
2018-11-12  2:24   ` Carlos O'Donell
2018-11-12  2:36     ` Greg KH
2018-11-12 16:08       ` Jonathan Corbet
2018-11-12 20:03         ` Greg KH
2018-12-09  4:38         ` Randy Dunlap
2018-12-10 16:27           ` Jonathan Corbet
2018-12-10 17:39             ` Carlos O'Donell
2018-12-10 23:32               ` Randy Dunlap
2018-11-12  5:46     ` Andy Lutomirski
2018-11-11  6:55 ` Michael Kerrisk (man-pages)
2018-11-11  8:17   ` Willy Tarreau
2018-11-11  8:25     ` Daniel Colascione
2018-11-11 10:40       ` Florian Weimer
2018-11-11 10:40         ` Florian Weimer
2018-11-11 10:30     ` Florian Weimer
2018-11-11 10:30       ` Florian Weimer
2018-11-11 11:02       ` Willy Tarreau
2018-11-11 12:07         ` Florian Weimer
2018-11-11 12:07           ` Florian Weimer
2018-11-11 10:53     ` Michael Kerrisk (man-pages)
2018-11-11 11:02       ` Florian Weimer
2018-11-11 11:02         ` Florian Weimer
2018-11-12 16:43         ` Joseph Myers
2018-11-13 15:15           ` Carlos O'Donell
2018-11-11 11:11       ` Willy Tarreau
2018-11-11 11:46         ` Florian Weimer
2018-11-11 11:46           ` Florian Weimer
2018-11-11 12:09           ` Willy Tarreau [this message]
2018-11-12 12:25             ` Florian Weimer
2018-11-12 12:25               ` Florian Weimer
2018-11-12 17:36             ` Joseph Myers
2018-11-12 17:53               ` Greg KH
2018-11-12 18:09                 ` Joseph Myers
2018-11-12 18:14                   ` Randy Dunlap
2018-11-12 16:59           ` Joseph Myers
2018-11-14 12:03           ` Adam Borowski
2018-11-14 12:10             ` Florian Weimer
2018-11-14 12:10               ` Florian Weimer
2018-11-16 21:24         ` Alan Cox
2018-11-11 11:09   ` Florian Weimer
2018-11-11 11:09     ` Florian Weimer
2018-11-11 14:22     ` Daniel Colascione
2018-11-12  1:44       ` Paul Eggert
2018-11-12  8:11       ` Florian Weimer
2018-11-12  8:11         ` Florian Weimer
2018-11-12 13:19         ` Daniel Colascione
2018-11-12 17:24           ` Zack Weinberg
2018-11-12 18:28             ` Daniel Colascione
2018-11-12 19:11               ` Florian Weimer
2018-11-12 19:11                 ` Florian Weimer
2018-11-12 19:26                 ` Daniel Colascione
2018-11-12 22:51                   ` Joseph Myers
2018-11-12 23:10                     ` Daniel Colascione
2018-11-12 23:26                       ` Joseph Myers
2018-11-12 22:34                 ` Joseph Myers
2018-11-13 19:39           ` Dave Martin
2018-11-13 20:58             ` Andy Lutomirski
2018-11-14 10:54               ` Dave Martin
2018-11-14 11:40                 ` Florian Weimer
2018-11-14 11:40                   ` Florian Weimer
2018-11-15 10:33                   ` Dave Martin
2018-11-14 11:58             ` Szabolcs Nagy
2018-11-14 14:46               ` Andy Lutomirski
2018-11-14 15:07                 ` Florian Weimer
2018-11-14 15:07                   ` Florian Weimer
2018-11-14 17:40                 ` Joseph Myers
2018-11-14 18:13                   ` Paul Eggert
2018-11-14 14:58               ` Carlos O'Donell
2018-11-14 17:15                 ` Arnd Bergmann
2018-11-14 18:30                   ` Joseph Myers
2018-11-14 18:30                     ` Joseph Myers
2018-11-14 15:40               ` Daniel Colascione
2018-11-14 18:15                 ` Joseph Myers
2018-11-14 18:35                   ` Daniel Colascione
2018-11-14 18:47                     ` Joseph Myers
2018-11-15  5:30                       ` Theodore Y. Ts'o
2018-11-15 16:29                         ` Joseph Myers
2018-11-15 17:08                           ` Theodore Y. Ts'o
2018-11-15 17:14                             ` Joseph Myers
2018-11-15 21:00                             ` Carlos O'Donell
2018-11-15 20:34                       ` Carlos O'Donell
2018-11-23 13:34           ` Florian Weimer
2018-11-23 13:34             ` Florian Weimer
2018-11-23 14:11             ` David Newall
2018-11-23 15:23               ` Szabolcs Nagy
2018-11-24  3:41                 ` David Newall
2018-11-28 13:18               ` David Laight
2018-11-23 20:15             ` Daniel Colascione
2018-11-23 23:19               ` Dmitry V. Levin
2018-11-12 12:45       ` Szabolcs Nagy
2018-11-12 14:35         ` Theodore Y. Ts'o
2018-11-12 14:40           ` Daniel Colascione

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181111120910.GA4425@1wt.eu \
    --to=w@1wt.eu \
    --cc=carlos@redhat.com \
    --cc=dancol@google.com \
    --cc=fweimer@redhat.com \
    --cc=joelaf@google.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.