This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: sigset_t for new arches
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Vineet Gupta <Vineet dot Gupta1 at synopsys dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 13 Nov 2017 14:54:53 -0800
- Subject: Re: sigset_t for new arches
- Authentication-results: sourceware.org; auth=none
- References: <98f1258a-8df3-77a3-be80-7b08ce7a1e9f@synopsys.com>
On Mon, Nov 13, 2017 at 2:29 PM, Vineet Gupta
<Vineet.Gupta1@synopsys.com> wrote:
> Hi,
>
> This came to light when initial testing ARC port to glibc.
>
> ARC glibc sigaction wrapper was failing as Linux kernel expects sa_mask
> (sigset_t) to be 2 words (for the asm-generic syscall ABI mandated for newer
> arches) while glibc defines it to be 32 words.
>
> The quick fix is to lie to kernel about it - and following works. This is
> also approach taken by few other arches.
>
> return INLINE_SYSCALL(rt_sigaction, 4,
> - sig, act, oact, sizeof(act->sa_mask));
> + sig, act, oact, _NSIG / 8);
>
>
> However, IMHO, it would be nicer to just define sigset_t to be 2 words wide
> for the relevant arch. If nothing else it would conserver some memory.
>
> My proposal is to define _SIGSET_NWORDS per arch in some header, with a
> fallback header defaulting to what the current value is. Does this make
> sense ? If yes, should this be in a new header or put in existing hdr etc.
No. See:
https://sourceware.org/ml/libc-alpha/2017-11/msg00412.html
--
H.J.