From owner-freebsd-stable Mon Apr 1 4:16:35 2002 Delivered-To: freebsd-stable@freebsd.org Received: from falcon.win.infodom.ru (falcon.infodom.ru [212.45.11.74]) by hub.freebsd.org (Postfix) with ESMTP id 35CF237B419 for ; Mon, 1 Apr 2002 04:16:30 -0800 (PST) Received: by falcon.win.infodom.ru with Internet Mail Service (5.5.2655.55) id ; Mon, 1 Apr 2002 16:16:28 +0400 Message-ID: <3649F9FBD2621F4498A022E513C5CA21015291@falcon.win.infodom.ru> From: =?koi8-r?Q?=E2=C5=D2=A3=DA=CB=CF_=E9=D7=C1=CE?= To: 'Nick Barnes' Cc: "'freebsd-stable@freebsd.org'" Subject: execl() after fork() in signal handler - strange things happen :) Date: Mon, 1 Apr 2002 16:16:23 +0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: text/plain; charset="koi8-r" 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 Hello. > > 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... :) > > It's because the signal is blocked in the signal handler (see > signal(3)). The signal mask is inherited by the execl child (see > sigprocmask(2)), so the signal is still masked in the child. Here's > a small modification of your program which shows this. Yes, that is it. Is it a correct behavior of the system? SUSv2 sais it is safe to call execl() from signal handlers (but I could not find anything about unblocking signals by hands). Will it be correct to unblock the signal mannualy? Good luck. Ivan Beriozko To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message