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

Ilya Zakharevich <nospam-abuse-qlYHBhoNh+/[email protected]> Sat, 20 Sep 2003 23:17:27 -0700
Newsgroups gmane.comp.ide.emx.devel
Message-ID <[email protected]>
On Sat, Sep 20, 2003 at 05:23:01PM +0200, Andreas Buening wrote:
> > > If you uncritically compile Unix programs that use a
> > > SIGCHLD handler, there is a good chance that your program will
> > > produce a deadlock.
> > 
> > Same is true on Unix: there are many different semantics.  If
> > possible, one should use POSIX interface...
> 
> 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.

> 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.

> 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.  ;-)  :-(

Yours,
Ilya