This is the mail archive of the
mailing list for the glibc project.
Re: Official Linux system wrapper library?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Daniel Colascione <dancol at google dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, Zack Weinberg <zackw at panix dot com>, "Michael Kerrisk (man-pages)" <mtk dot manpages at gmail dot com>, Linux Kernel Mailing List <linux-kernel at vger dot kernel dot org>, Joel Fernandes <joelaf at google dot com>, Linux API <linux-api at vger dot kernel dot org>, Willy Tarreau <w at 1wt dot eu>, Vlastimil Babka <vbabka at suse dot cz>, Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 12 Nov 2018 22:51:03 +0000
- Subject: Re: Official Linux system wrapper library?
- References: <CAKOZuesB4R=dCz4merWQN0FSCGrXmOgUUr4ienSbStBJguNv8g@mail.gmail.com> <firstname.lastname@example.org> <email@example.com> <CAKOZues5SEESpJU=6MDTrPXTA1KTZFGNQE4Lw4t0fO-WBTU62w@mail.gmail.com> <firstname.lastname@example.org> <CAKOZuetdgk1QYhx1538-98rFpogMin=8DkPnCtU9_=ip23Vk7w@mail.gmail.com> <CAKCAbMiHC9r54h=XeW7CkBZ1Z5eHr9MPH3Rn7KTc9DjoHG=8UA@mail.gmail.com> <CAKOZuev7zqq+xpjyDA2mSdy-zwyNjECCzLsBELF6_v1rwar_mA@mail.gmail.com> <email@example.com> <CAKOZues2bQo1y_1ynxFMHGTvtTjABsqVpKJt5MYMdZBq6-ikHA@mail.gmail.com>
On Mon, 12 Nov 2018, Daniel Colascione wrote:
> The two features *are* unrelated. The design I've proposed works
> equally well for synchronous and asynchronous signals, and limiting it
Whatever the design, I see no obvious reason why a kernel-provided
library, with all the problems that entails, should need to be involved,
rather than putting new APIs either in libc or in a completely separate
libsignal for libraries wanting to use such a system for cooperative
(I can imagine *other* parts of the toolchain being involved, if e.g. you
want to have a good way of checking "is the address of the instruction
causing this signal in this library?" that works with static as well as
dynamic linking - for dynamic linking, I expect something could be done
using libc_nonshared and __dso_handle to identify code in the library
calling some registering function. And indeed there might also be new
kernel interfaces that help improve signal handling.)
In the absence of consensus for adding such a new API for signals to
glibc, it's unlikely one would get consensus for glibc to depend on some
other library providing such an API either. But you can always write a
library (which I think would most naturally be a completely separate
libsignal, not part of the kernel source tree) and seek to persuade
libraries they should be using it rather than interfering with global
state by registering normal signal handlers directly.
Joseph S. Myers