Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Nov 2009 23:11:50 +0100
From:      Jilles Tjoelker <jilles@stack.nl>
To:        Alexander Best <alexbestms@math.uni-muenster.de>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: SIGUNUSED
Message-ID:  <20091106221150.GA60707@stack.nl>
In-Reply-To: <permail-20091106213357f0889e84000012ed-a_best01@message-id.uni-muenster.de>
References:  <permail-20091106213357f0889e84000012ed-a_best01@message-id.uni-muenster.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091106221150.GA60707>