From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 6 22:11:52 2009 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC6571065692 for ; Fri, 6 Nov 2009 22:11:52 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 923F08FC0C for ; Fri, 6 Nov 2009 22:11:52 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A9E061DD642; Fri, 6 Nov 2009 23:11:50 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 9F075228C0; Fri, 6 Nov 2009 23:11:50 +0100 (CET) Date: Fri, 6 Nov 2009 23:11:50 +0100 From: Jilles Tjoelker To: Alexander Best Message-ID: <20091106221150.GA60707@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers@FreeBSD.org Subject: Re: SIGUNUSED X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2009 22:11:52 -0000 On Fri, Nov 06, 2009 at 10:33:57PM +0100, Alexander Best wrote: > some programmers tend to do the following in their apps to install a standard > handler for all signals (mostly SIG_IGN): > int counter; > for (counter = 1; counter < SIGUNUSED; counter++) > signal(counter, SIG_IGN); > any objections if we also have SIGUNUSED in our signal.h? seems like a > reasonable addition. since the highest signal number (excluding > SIGRT[MIN|MAX]) is SIGTHR with 32 we could add > #define SIGUNUSED 33 That code is wrong, SIGUNUSED is not meant to be used in that way. It seems to originate from Linux, but it is not available on all architectures there, and where it is available it is a valid signal. Also, ignoring all signals tends not to be a good idea. For traps, it's either the same as the default action (FreeBSD unless admin sets kern.forcesigexit=0), or it is an infinite loop or other undefined behaviour. -- Jilles Tjoelker