From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31527 invoked from network); 28 Jul 2021 18:43:46 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2021 18:43:46 -0000 Received: (qmail 5508 invoked by uid 550); 28 Jul 2021 18:43:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5481 invoked from network); 28 Jul 2021 18:43:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=date:to:subject:from:references:in-reply-to:message-id:user-agent; bh=xDXeRuKaVgx066tDlpAg7Hc4UIhvwh30nHiGPmjJX+w=; b=RjjpFzBS+wVR2QU4tGtCqGrITBxHvlPW2BR3QtNxmxsc2hgOkO/JVU9j5+hSshRXY+ hrPsk3wfbZ85jhqQpoNMdqNghgOB1JSL7Xp3Ii87SfEGX7p0DRiANRx/J04CcfemHZD5 u1omv0NY/gQtG09WOFRVzuG4uIIKKwIdWT9Y1fro4i8XuonIOntUiMiPh87fWTvTvh58 Xhm2Yy0knmCA2/TMNHNbcJmuOElJhdJAQyaaf3vRu/m8dG+qhEvf8XoWJtVGUNzisGPX HSXRq4TW/vgaFIp6uXXUZF/chDelI1AwOv78/fmXazts7hEQvr/lqaGGYYTB9yeUQEXu 7krg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:to:subject:from:references:in-reply-to :message-id:user-agent; bh=xDXeRuKaVgx066tDlpAg7Hc4UIhvwh30nHiGPmjJX+w=; b=eP0Y7091OOXD9pMYHHgpEqOS42WpPS7WozFKu/rsGi7oC6cE5NetdqI3rJ9SXhP9Mk hIo5O2EproR2hpHceAwRvxa7fpQMfDHslPSZDp+ypBZ2kO53JaSeDjwwlefzscaBv+wl 8xRhC5hlegzBT1GzQ7YWOh94GxHHehXFH08kuIxRqscKhowJIQbhI+ZTMDF7wMe1MFsw n9WUV/zVg7BjXAcIspJVxiPqveNpIfzRhME7kQnCPHaYDbSwEK537dzjX43cFVcnfzU+ MhOjJyZT2mZa8FGSU47GOA3sY8iMeFSVpJFSFmLc39mNjvfUevq2hJe4R4MxNkv3wEdu UDyA== X-Gm-Message-State: AOAM533D/DJ1XBpxcPJjgqCRYAE8oXupapT8t2e7zZjtbsYnOmoxl2NS KlHmQQ5vC+66soVCvQUeaV/mGu8I5+5akfl/WbM= X-Google-Smtp-Source: ABdhPJz1XhvdUWO9Q2HpluGfvxDHDO+JGVRV7FmG6zw0Y1Gh+GYa4FDUOgbYRSjL8Zc+O6Gt45/F2w== X-Received: by 2002:a17:902:8ec6:b029:12b:ab33:15d4 with SMTP id x6-20020a1709028ec6b029012bab3315d4mr904063plo.80.1627497811150; Wed, 28 Jul 2021 11:43:31 -0700 (PDT) Date: Wed, 28 Jul 2021 11:43:29 -0700 To: musl@lists.openwall.com From: Michael Forney References: <20210728155340.GQ13220@brightrain.aerifal.cx> In-Reply-To: Message-Id: <222WPE66U74QU.3HRJMZ5QFQOAF@mforney.org> User-Agent: mblaze/1.1 Subject: Re: [musl] Bug in src/signal/block.c "Laurent Bercot" 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 ) 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.