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=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 5062 invoked from network); 28 Jul 2021 19:30:59 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2021 19:30:59 -0000 Received: (qmail 22354 invoked by uid 550); 28 Jul 2021 19:30:57 -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 22336 invoked from network); 28 Jul 2021 19:30:56 -0000 Date: Wed, 28 Jul 2021 15:30:44 -0400 From: Rich Felker To: Laurent Bercot Cc: musl@lists.openwall.com Message-ID: <20210728193044.GR13220@brightrain.aerifal.cx> References: <20210728155340.GQ13220@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Bug in src/signal/block.c 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