From owner-freebsd-questions Thu Apr 5 14:11: 9 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dsl-64-193-218-89.telocity.com (dsl-64-193-218-89.telocity.com [64.193.218.89]) by hub.freebsd.org (Postfix) with SMTP id C3B6737B43C for ; Thu, 5 Apr 2001 14:11:06 -0700 (PDT) (envelope-from lucas@slb.to) Received: (qmail 27472 invoked by uid 1000); 5 Apr 2001 21:11:23 -0000 Date: Thu, 5 Apr 2001 16:11:23 -0500 From: Lucas Bergman To: Arcady Genkin Cc: freebsd-questions@FreeBSD.ORG Subject: Re: [OT] Reinstalling signal handler inside signal handler Message-ID: <20010405161123.A18827@billygoat.slb.to> Reply-To: lucas@slb.to References: <87d7ardw5s.fsf@tea.thpoon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <87d7ardw5s.fsf@tea.thpoon.com>; from antipode@thpoon.com on Thu, Apr 05, 2001 at 02:43:59PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > FreeBSD man page for signal(3) states that > > Unlike previous signal facilities, the handler func() remains > installed after a signal has been delivered. > > What "previous" signal facilities is this referring to? I've seen a > lot of code where a signal handler function would re-install itself > the first thing. But I've tested, and that doesn't appear to be > necessary at least on FreeBSD and Linux. Signals on "traditional" systems (V7, System V) were reset to their default behavior after they were raised, so the signal handler had to reinstall itself if it was to persist. BSD changed that; you have to deliberately reset a signal's behavior (excuse the split infinitive). Linux actually follows the old semantics, but you can include instead of (or call __bsd_signal() instead of signal()) to get the BSD semantics. Confused yet? Lucas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message