mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: Laurent Bercot <ska-dietlibc@skarnet.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] Bug in src/signal/block.c
Date: Wed, 28 Jul 2021 15:30:44 -0400	[thread overview]
Message-ID: <20210728193044.GR13220@brightrain.aerifal.cx> (raw)
In-Reply-To: <emc179d218-6e77-465e-8999-3df669670fa1@elzian>

On Wed, Jul 28, 2021 at 05:11:11PM +0000, Laurent Bercot wrote:
> >> succeed since _NSIG will be 128 instead of 129.
> 
>  I happen to be in the process of updating my programming library
> performing workarounds for badly-specified parts of POSIX and related
> functions.
> 
>  NSIG is one of those parts. It is not specified by POSIX, but it is
> useful to have a walkable (as in, not 8*sizeof(sigset_t)) upper bound
> for the number of signals on a system.

I thought it was going to be POSIX-future, but maybe they did the ugly
_SC_NSIG-only approach instead (which partly defeats the purpose,
although you can use 8*sizeof(sigset_t) as an ugly upper bound on
NSIG where you need a constant expression).

>  But NSIG is badly specified even across the systems where it exists.
> On glibc, it is 1 + the highest signal number. On FreeBSD and OpenBSD
> at least, it is the highest signal number.

That's unfortunate.

>  musl appears to align on glibc; I suppose the value for MIPS will be
> updated to 129, for consistency.

No. The greatest signal number on mips is 127, not 128. There's a long
story behind this and it involves the kernel doing stupid stuff.
Inspect sys/wait.h if you want to try to figure it out yourself. :-)

Rich

  parent reply	other threads:[~2021-07-28 19:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28 15:00 Jasper Hugunin
2021-07-28 15:53 ` Rich Felker
2021-07-28 17:11   ` Laurent Bercot
2021-07-28 18:43     ` Michael Forney
2021-07-28 19:30     ` Rich Felker [this message]
2021-07-28 19:36   ` Rich Felker
2021-07-28 19:52     ` Jasper Hugunin
2021-07-28 22:04       ` Rich Felker

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=20210728193044.GR13220@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=ska-dietlibc@skarnet.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).