Re: Re: [UnixOS2] waitpid : why does this not work?

Andreas Buening <[email protected]> Sun, 21 Sep 2003 23:36:33 +0200
Newsgroups gmane.comp.ide.emx.devel
Message-ID <[email protected]>
Ilya Zakharevich wrote:
> 
> On Sat, Sep 20, 2003 at 05:23:01PM +0200, Andreas Buening wrote:

> > There is one big difference between Unix and OS/2 systems: SIGCHLD
> > never dies. On OS/2 you MUST get the ID of the child process by
> > wait() or waitpid(), otherwise the signal is pending. This means,
> 
> Let me repeat: there is no such thing as "Unix".  IIRC, EM did not
> invent this flavor of signal handling himselves; it exists on some
> flavors of Unix as well.

You mean there is a Unix system where SIGCHLD is pending until anybody
calls wait() or waitpid()?


> > if you install a SIGCHLD handler which does NOT call waitpid(),
> > the signal handler is called in an infinite loop and the process
> > hangs. I don't know whether it's an OS/2 or just an EMX feature
> > but it's real.
> 
> It is real, but (IMO) it does not support your point.  Portable
> programs already call wait() inside the handler.

At least GNU make installs a child handler that does NOT call wait().
(That's the reason why older make ports for OS/2 have to be compiled
with -Zsys, otherwise the child handler locks up the process.)
From this fact I've concluded that there is no Unix system which has
a pending SIGCHLD, otherwise make would lock up also on those systems.


> > Btw., please do not send a copy to the UnixOS/2 list as 'CC' but
> > as 'TO' because your posting is ignored otherwise (don't know why).
>
> I will this time, but no promises to remember this tomorrow.  ;-)  :-(

You did it again. ;-)
Please do NOT CC to the Mailing list. 


Bye,
Andreas