From owner-freebsd-stable Sat Mar 30 12:25:23 2002 Delivered-To: freebsd-stable@freebsd.org Received: from vulcan.rsasecurity.com (vulcan.rsasecurity.com [204.167.114.130]) by hub.freebsd.org (Postfix) with SMTP id 319F637B405 for ; Sat, 30 Mar 2002 12:25:20 -0800 (PST) Received: from sdtihq24.securitydynamics.com by vulcan.rsasecurity.com via smtpd (for [216.136.204.18]) with SMTP; 30 Mar 2002 20:24:28 UT Received: from ebola.securitydynamics.com (ebola.securid.com [192.80.211.4]) by sdtihq24.securid.com (Pro-8.9.3/Pro-8.9.3) with ESMTP id PAA06836 for ; Sat, 30 Mar 2002 15:24:23 -0500 (EST) Received: from spirit.dynas.se (localhost [127.0.0.1]) by ebola.securitydynamics.com (8.10.2+Sun/8.9.1) with SMTP id g2UKPIS17336 for ; Sat, 30 Mar 2002 15:25:18 -0500 (EST) Received: (qmail 28355 invoked from network); 30 Mar 2002 20:25:14 -0000 Received: from explorer.rsa.com (HELO mikko.rsa.com) (10.81.217.59) by spirit.dynas.se with SMTP; 30 Mar 2002 20:25:14 -0000 Received: (from mikko@localhost) by mikko.rsa.com (8.11.6/8.11.6) id g2UKP9701386; Sat, 30 Mar 2002 12:25:09 -0800 (PST) (envelope-from mikko) Date: Sat, 30 Mar 2002 12:25:09 -0800 (PST) From: Mikko Tyolajarvi Message-Id: <200203302025.g2UKP9701386@mikko.rsa.com> To: iberiozko@infodom.ru Cc: stable@freebsd.org Orig-To: =?koi8-r?Q?=E2=C5=D2=A3=DA=CB=CF_=E9=D7=C1=CE?= Subject: Re: execl() after fork() in signal handler - strange things happen :) Newsgroups: local.freebsd.stable References: <3649F9FBD2621F4498A022E513C5CA2101528B@falcon.win.infodom.ru> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In local.freebsd.stable you write: >Hello, people. >The problem is - when doing execl() after fork() inside a signal handler, >the signal is not delivered to executed child anymore. Is this correct? (I >understand, that doing such things is a bad idea, but... :) Looks like a result of the signal by default being blocked while the signal handler is executing. The child inherits the signal mask. Looks like linux (some version) behaves in the same way, but not (random versions of) solaris, hp-ux and aix. If you want to portably have full control over signal handling, you have to do it yourself using sigprocmask(), sigaction() etc. And yes, it is probably a bad idea to call things like syslog() in a signal handler :^) $.02, /Mikko -- Mikko Työläjärvi_______________________________________mikko@rsasecurity.com RSA Security To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message