From owner-freebsd-hackers@FreeBSD.ORG Sat Nov 7 02:34:12 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 1FF76106566B for ; Sat, 7 Nov 2009 02:34:12 +0000 (UTC) (envelope-from nate@thatsmathematics.com) Received: from euclid.ucsd.edu (euclid.ucsd.edu [132.239.145.52]) by mx1.freebsd.org (Postfix) with ESMTP id 01B888FC12 for ; Sat, 7 Nov 2009 02:34:11 +0000 (UTC) Received: from zeno.ucsd.edu (zeno.ucsd.edu [132.239.145.22]) by euclid.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id nA72YBo17750; Fri, 6 Nov 2009 18:34:11 -0800 (PST) Received: from localhost (neldredg@localhost) by zeno.ucsd.edu (8.11.7p3+Sun/8.11.7) with ESMTP id nA72YBU16331; Fri, 6 Nov 2009 18:34:11 -0800 (PST) X-Authentication-Warning: zeno.ucsd.edu: neldredg owned process doing -bs Date: Fri, 6 Nov 2009 18:34:11 -0800 (PST) From: Nate Eldredge X-X-Sender: neldredg@zeno.ucsd.edu To: Alexander Best In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-hackers@freebsd.org, Jilles Tjoelker 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:34:12 -0000 On Sat, 7 Nov 2009, Alexander Best wrote: > 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); >> 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. > oh. i see. i'm not a linux user. that's why i thought SIGUNUSED was designed > exactly for that purpose. I think that's what NSIG was for. But it seems to be BSD-specific, and perhaps obsolecent. -- Nate Eldredge nate@thatsmathematics.com