Date: Mon, 1 Apr 2002 16:16:23 +0400 From: =?koi8-r?Q?=E2=C5=D2=A3=DA=CB=CF_=E9=D7=C1=CE?= <iberiozko@infodom.ru> To: 'Nick Barnes' <Nick.Barnes@pobox.com> Cc: "'freebsd-stable@freebsd.org'" <freebsd-stable@freebsd.org> Subject: execl() after fork() in signal handler - strange things happen :) Message-ID: <3649F9FBD2621F4498A022E513C5CA21015291@falcon.win.infodom.ru>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3649F9FBD2621F4498A022E513C5CA21015291>