From owner-freebsd-current Fri Dec 11 01:50:50 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id BAA12383 for freebsd-current-outgoing; Fri, 11 Dec 1998 01:50:50 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sparky.isocor.com (sparky.isocor.com [198.6.228.217]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id BAA12378 for ; Fri, 11 Dec 1998 01:50:49 -0800 (PST) (envelope-from peter.edwards@isocor.ie) Received: from isocor.ie (198.6.229.204) by sparky.isocor.com (NPlex 4.0.000); Fri, 11 Dec 1998 01:50:03 -0800 Message-ID: <3670EC02.D35D99CC@isocor.ie> Date: Fri, 11 Dec 1998 01:55:14 -0800 From: Peter Edwards Organization: ISOCOR X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Archie Cobbs CC: Matthew Dillon , jwd@unx.sas.com, freebsd-current@FreeBSD.ORG Subject: Re: inetd: realloc/free bug References: <199812110628.WAA23665@bubba.whistle.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, > > It's not trivial if you want to guarantee that no signals are missed. > There's no way atomically to: unblock signals and call select(). Hmm. I must be twisted. What horror results from doing this in a signal handler? On e-paper, it seems to give the desired effect, but does a return from a signal handler implicitly call sigreturn(2) when it returns? And if so, is there anything that requires this to happen? ... sigusr1handler() { longjmp(jump_buf,1); } selecting_func() { if (setjmp(jump_buf) == 0) { sigprocmask(SIG_UNBLOCK, {...SIGUSR1...}, 0) /* Signal arriving now returns after the select call. */ select(...); sigprocmask(SIG_BLOCK, {...SIGUSR1...}, 0); } /* select finished, or signal arrived after the sigprocmask(SIG_UNBLOCK). */ } -- Peter. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message