From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 7 02:17: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 671D3106566B for ; Sat, 7 Nov 2009 02:17:52 +0000 (UTC) (envelope-from a_best01@uni-muenster.de) Received: from zivm-exrelay2.uni-muenster.de (ZIVM-EXRELAY2.UNI-MUENSTER.DE [128.176.192.15]) by mx1.freebsd.org (Postfix) with ESMTP id EE74C8FC1A for ; Sat, 7 Nov 2009 02:17:51 +0000 (UTC) X-IronPort-AV: E=Sophos;i="4.44,697,1249250400"; d="scan'208";a="228293785" Received: from zivmaildisp1.uni-muenster.de (HELO ZIVMAILUSER04.UNI-MUENSTER.DE) ([128.176.188.85]) by zivm-relay2.uni-muenster.de with ESMTP; 07 Nov 2009 03:17:50 +0100 Received: by ZIVMAILUSER04.UNI-MUENSTER.DE (Postfix, from userid 149459) id 4BA251B07BE; Sat, 7 Nov 2009 03:17:50 +0100 (CET) Date: Sat, 07 Nov 2009 03:17:49 +0100 (CET) From: Alexander Best Sender: Organization: Westfaelische Wilhelms-Universitaet Muenster To: Jilles Tjoelker , Alexander Best Message-ID: In-Reply-To: <20091106221150.GA60707@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: Sat, 07 Nov 2009 02:17:52 -0000 Jilles Tjoelker schrieb am 2009-11-06: > 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. oh. i see. i'm not a linux user. that's why i thought SIGUNUSED was designed exactly for that purpose. as a side not: our own easyedit does exactly what you said wasn't a good programming style. ;) check line 554 of contrib/ee/ee.c: for (counter = 1; counter < 24; counter++) signal(counter, SIG_IGN); cheers. alex