From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Benjamin Berg <benjamin@sipsolutions.net>,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v2 4/4] tools/nolibc: add signal support
Date: Sun, 13 Jul 2025 17:50:02 +0200 [thread overview]
Message-ID: <20250713155002.GA25876@1wt.eu> (raw)
In-Reply-To: <3f901ecb-d6d1-4fb4-9159-a6b817b0dd39@t-8ch.de>
On Sun, Jul 13, 2025 at 05:02:27PM +0200, Thomas Weißschuh wrote:
> On 2025-07-11 09:25:26+0200, Benjamin Berg wrote:
> > On Fri, 2025-07-11 at 07:40 +0200, Thomas Weißschuh wrote:
> > > On 2025-07-10 12:39:50+0200, Benjamin Berg wrote:
> > > > From: Benjamin Berg <benjamin.berg@intel.com>
> > > >
> > > > Add support for sigaction() and implement the normal sa_mask helpers.
> > > >
> > > > On many architectures, linux/signal.h pulls in compatibility
> > > > definitions
> > > > for the old sigaction syscall instead of rt_sigaction. However, the
> > > > kernel can be compiled without support for this compatibility
> > > > syscall
> > > > and it also results in sa_mask to be too small for realtime
> > > > signals.
> > > >
> > > > To work around this, the includes are handled separately for each
> > > > architecture. This way either linux/signal.h or the asm-generic
> > > > headers
> > > > can be used to get the correct definition for the rt_sigaction
> > > > syscall
> > > > including sigset_t.
> > >
> > > I checked this against my WIP alpha support and there this scheme
> > > breaks. linux/signal.h provides the old compat types but
> > > the asm-generic variant provides an incorrect SIGCHLD.
> > >
> > > Any ideas?
> >
> > I had a quick look, and I don't have a good idea really. For sparc
> > there was at least a #define that permitted to get the correct version.
> > But here, there is nothing.
> >
> > Probably the best is to just copy in a modified version of signal.h
> > with the correct definitions present. i.e. replace the "ifndef
> > __KERNEL__" sections with something reasonable.
>
> But then we can just have our own copy for every architecture, no?
> To me that looks like the best solution right now.
I generally agree. Originally in nolibc, lots of stuff was copied and
we only used very little of UAPI. As new architectures were supported,
we took this opportunity for cleaning this up and relying more on UAPI,
but that doesn't mean we need to get rid of our local definitions all
the time, so if that helps, yeah clearly we can have our local copies
and definitions.
Cheers,
Willy
next prev parent reply other threads:[~2025-07-13 15:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 10:39 [PATCH v2 0/4] signal handling support for nolibc Benjamin Berg
2025-07-10 10:39 ` [PATCH v2 1/4] selftests/nolibc: fix EXPECT_NZ macro Benjamin Berg
2025-07-11 4:46 ` Thomas Weißschuh
2025-07-10 10:39 ` [PATCH v2 2/4] selftests/nolibc: validate order of constructor calls Benjamin Berg
2025-07-11 4:50 ` Thomas Weißschuh
2025-07-10 10:39 ` [PATCH v2 3/4] tools/nolibc: add more generic bitmask macros for FD_* Benjamin Berg
2025-07-10 10:39 ` [PATCH v2 4/4] tools/nolibc: add signal support Benjamin Berg
2025-07-11 5:40 ` Thomas Weißschuh
2025-07-11 7:25 ` Benjamin Berg
2025-07-13 15:02 ` Thomas Weißschuh
2025-07-13 15:50 ` Willy Tarreau [this message]
2025-07-14 12:52 ` Benjamin Berg
2025-07-14 13:33 ` Thomas Weißschuh
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=20250713155002.GA25876@1wt.eu \
--to=w@1wt.eu \
--cc=benjamin@sipsolutions.net \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux@weissschuh.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).