Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20261104162707.GT23438@brightrain.aerifal.cx>
Date: Wed, 4 Nov 2026 11:27:08 -0500
From: Rich Felker <dalias@...c.org>
To: Imre Kaloz <kaloz@...nel.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH 04/10] add SYSCALL_RT_SIGACTION_RESTORER hook for
 sparc

On Wed, Nov 04, 2026 at 04:10:58PM +0100, Imre Kaloz wrote:
> Hi Rich,
> 
> On Wed, Nov 4, 2026, at 14:19, Rich Felker wrote:
> > On Wed, Nov 04, 2026 at 08:15:01AM -0500, Rich Felker wrote:
> >> On Wed, Nov 04, 2026 at 10:12:03AM +0100, Imre Kaloz wrote:
> 
> <snip>
> 
> >> > I'd do both. The generic part is below as an RFC; with it, sparc64
> >> > would define
> >> > 
> >> > #define __sys_sigaction(sig,sa,old) \
> >> > 	__syscall(__NR_rt_sigaction,sig,sa,old,__restore,_NSIG/8)
> >> > #undef SYS_rt_sigaction
> >> 
> >> I'm pretty sure this breaks expansion of __sys_sigaction.
> 
> I checked, and as posted it does expand: the body uses
> __NR_rt_sigaction, which the #undef leaves alone. Good thing to double
> check, though, since a body using SYS_rt_sigaction would have broken
> every call site.

Oh I missed that. I'm not sure I like it but at least it's viable.

> >> It might be better to write an inline function by the same name and
> >> just define the macro to itself. That gets rid of the multi-line
> >> macros too.
> >
> > The inline function would also fix the issue with undefining the
> > SYS_rt_sigaction macro, but I think it makes a new issue by depending
> > on _NSIG. Maybe the macro can add _NSIG in the arguments to the inline
> > function.
> 
> Thanks, the inline function is much cleaner. The 32-bit one needs
> struct k_sigaction and SA_SIGINFO, so in v2 it would live in
> arch/sparc/ksigaction.h, whose users include signal.h first; _NSIG is
> visible there. syscall_arch.h would only have

Hmm, putting the inline function in ksigaction.h? Kinda ugly but it
might work to avoid pulling in unwanted headers all over.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.