reinstalling SIGCHLD handler before wait()

Wojtek Pilorz wpilorz at bdk.pl
Wed Dec 13 21:17:46 EST 2000


On Wed, 13 Dec 2000, Gert Doering wrote:

> Date: Wed, 13 Dec 2000 10:30:18 +0100
> From: Gert Doering <gert at greenie.muc.de>
> To: Wojtek Pilorz <wpilorz at bdk.pl>,
>      Markus Friedl <Markus.Friedl at informatik.uni-erlangen.de>
> Cc: Damien Miller <djm at mindrot.org>, Kevin Steves <stevesk at pobox.com>,
>      openssh-unix-dev at mindrot.org
> Subject: Re: reinstalling SIGCHLD handler before wait()
> 
> Hi,
> 
> On Wed, Dec 13, 2000 at 10:24:03AM +0100, Wojtek Pilorz wrote:
> > I believe sigaction in considered more robust and preferred way of
> > handling signals.
> 
> But a lot less portable.  Especially older SysV systems do not have
> sigaction().
Yes, but I believe the vast majority of UNIX and UNIX-like systems do
provide sigaction (sigaction is required by POSIX, isn't it?), and for
those systems it would be preferred way of handling signals.
For the systems which are not enough POSIX-compatible me might
1. choose not to support them
2. use some #ifdefs throughout the code
3. use emulation as it is done for snprintf now (there is even 
  file openssh/bsd-sigaction.c which emulates sigaction using sigvec;
  do those older SysV systems define sigvec?)

Each of the approaches would have pros and cons.

Also, please note that sigaction is already being used in
scp.c; And while it is used in a rather not critical piece
of code (progressmeter function), if we had heard no complaints about it
so far. maybe even option 1. would be acceptable? 

If we stick with signal there will always be some race conditions after a
signal is received and before its handler is installed again.

> 
> gert
> -- 
> USENET is *not* the non-clickable part of WWW!
>                                                            //www.muc.de/~gert/
> Gert Doering - Munich, Germany                             gert at greenie.muc.de
> fax: +49-89-35655025                        gert.doering at physik.tu-muenchen.de
> 
Best regards,

Wojtek






More information about the openssh-unix-dev mailing list