Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Mar 2002 12:25:09 -0800 (PST)
From:      Mikko Tyolajarvi <mikko@dynas.se>
To:        iberiozko@infodom.ru
Cc:        stable@freebsd.org
Subject:   Re: execl() after fork() in signal handler - strange things happen :)
Message-ID:  <200203302025.g2UKP9701386@mikko.rsa.com>
References:  <3649F9FBD2621F4498A022E513C5CA2101528B@falcon.win.infodom.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203302025.g2UKP9701386>