Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Benjamin Berg <benjamin@sipsolutions.net>
Cc: "Willy Tarreau" <w@1wt.eu>,
	linux-kselftest@vger.kernel.org,
	"Thomas Weißschuh" <thomas.weissschuh@linutronix.de>
Subject: Re: [RFC v2] tools/nolibc: add sigaction()
Date: Fri, 4 Jul 2025 12:50:32 +0200	[thread overview]
Message-ID: <81dc0649-9abe-421d-a372-a346c329d3af@t-8ch.de> (raw)
In-Reply-To: <c870d823e686c4b4ef6928d9ca0162d72e484339.camel@sipsolutions.net>

On 2025-07-02 17:33:24+0200, Benjamin Berg wrote:
> On Wed, 2025-07-02 at 00:04 +0200, Thomas Weißschuh wrote:
> > [SNIP]
> > > --- a/tools/include/nolibc/arch-i386.h
> > > +++ b/tools/include/nolibc/arch-i386.h
> > > @@ -10,6 +10,19 @@
> > >  #include "compiler.h"
> > >  #include "crt.h"
> > >  
> > > +/* Needed to get the correct struct sigaction definition */
> > > +#define SA_RESTORER	0x04000000
> > > +
> > > +/* Restorer must be set on i386 */
> > > +#define _NOLIBC_ARCH_NEEDS_SA_RESTORER
> > > +
> > > +/* Otherwise we would need to use sigreturn instead of rt_sigreturn */
> > > +#define _NOLIBC_ARCH_FORCE_SIG_FLAGS SA_SIGINFO
> > > +
> > > +/* Avoid linux/signal.h, it has an incorrect _NSIG and sigset_t */
> > > +#include <asm-generic/signal.h>
> > > +#include <asm-generic/siginfo.h>
> > 
> > This doesn't work if the user already has <linux/signal.h> included for
> > some other reason. The symbol names will conflict.
> 
> I was thinking this is fine. Such a conflict already exists between the
> normal glibc <signal.h> and <linux/signal.h>.

It would be enough to keep compatibility with glibc.
But personally I'd like to make it work generally.

> So there would only be a
> problem if the user is explicitly not including <signal.h> to then use
> <linux/signal.h>. I doubt that makes sense.

Technically nolibc is always included as a whole, so any application
using it would be prevented from using linux/signal.h.

Maybe Willy has some strong opinions.
Otherwise I'm also fine if we keep this part as is for now.
Then if everything else is addressed I'll try to actually implement my
proposal on top.

Does this sound reasonable?


Thomas

  reply	other threads:[~2025-07-04 10:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 12:29 [RFC v2] tools/nolibc: add sigaction() Benjamin Berg
2025-07-01 22:04 ` Thomas Weißschuh
2025-07-02 15:33   ` Benjamin Berg
2025-07-04 10:50     ` Thomas Weißschuh [this message]
2025-07-04 13:33       ` Willy Tarreau
2025-07-07 15:22         ` 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=81dc0649-9abe-421d-a372-a346c329d3af@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=benjamin@sipsolutions.net \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=thomas.weissschuh@linutronix.de \
    --cc=w@1wt.eu \
    /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