From owner-freebsd-hackers Wed Jan 31 12:51:51 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA09354 for hackers-outgoing; Wed, 31 Jan 1996 12:51:51 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA09346 for ; Wed, 31 Jan 1996 12:51:47 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA10480; Wed, 31 Jan 1996 13:47:05 -0700 From: Terry Lambert Message-Id: <199601312047.NAA10480@phaeton.artisoft.com> Subject: Re: signal masks and select To: paul@sfe.com.au (Paul Hatchman) Date: Wed, 31 Jan 1996 13:47:05 -0700 (MST) Cc: leisner@sdsp.mc.xerox.com, linux-kernel@vger.rutgers.edu, hackers@FreeBSD.ORG In-Reply-To: <199601310749.AA28625@rex.sfe.com.au> from "Paul Hatchman" at Jan 31, 96 06:49:00 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG Precedence: bulk > > This can be "solved" by using setjmp/longjmp with select. > ie > if (setjmp (env, 1) == 0) > { > set_sigmask(unblock desired signals) > select(...) > } > > and your signal handler does a longjmp (env) > > There are drawbacks to this.. If you want to unblock signals outside of the > select, you must keep extra state information around, so that the signal handler > knows whether to do a normal return or a longjmp. > > May not be elegant, but it is surely better than using non portable methods. > Actually is this truely portable? Will all unicies support longjmp from a > signal handler? sigaction should be portable to all POSIX platforms. siginterrupt should be portable to all BSD platforms starting with 4.2 Ultrix. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.