mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Michael Forney <mforney@mforney.org>
To: musl@lists.openwall.com
Subject: Re: [musl] Bug in src/signal/block.c
Date: Wed, 28 Jul 2021 11:43:29 -0700	[thread overview]
Message-ID: <222WPE66U74QU.3HRJMZ5QFQOAF@mforney.org> (raw)
In-Reply-To: <emc179d218-6e77-465e-8999-3df669670fa1@elzian>

"Laurent Bercot" <ska-dietlibc@skarnet.org> wrote:
>   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.
>
>   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.

The current draft of POSIX issue 8 includes a resolution for
https://www.austingroupbugs.net/view.php?id=741 (Add a NSIG constant
(or, alternatively, SIGMAX))

However, rather than adding NSIG, they introduced a new sysconf
variable _SC_NSIG, defined as the highest supported signal number
+ 1, and NSIG_MAX, which is defined as follows:

  Maximum possible return value of sysconf(_SC_NSIG). See XSH sysconf().
  The value of {NSIG_MAX} shall be no greater than the number of
  signals that the sigset_t type (see <signal.h>) is capable of
  representing, ignoring any restrictions imposed by sigfillset() or
  sigaddset().

They probably went with this route instead of specifying NSIG due
to those inconsistencies you mentioned. Unfortunately, as far as
I'm aware, both _SC_NSIG and NSIG_MAX are not yet present in any
libc.

  reply	other threads:[~2021-07-28 18:43 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 [this message]
2021-07-28 19:30     ` Rich Felker
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=222WPE66U74QU.3HRJMZ5QFQOAF@mforney.org \
    --to=mforney@mforney.org \
    --cc=musl@lists.openwall.com \
    /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).