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

Andreas Buening <[email protected]> Sat, 20 Sep 2003 17:23:01 +0200
Newsgroups gmane.comp.ide.emx.devel
Message-ID <[email protected]>
Ilya Zakharevich wrote:
> 
> On Fri, Sep 19, 2003 at 01:36:56AM +0200, Andreas Buening wrote:
> 
> > SIGCHLD is different on OS/2.
> 
> Nonsense.  There is no SIGCHLD on OS/2.  However, there are some on EMX.
> 
> In fact, there are too many: out of many different semantics of signal
> processing, EMX supports two - distinguished by -Zbsd-signals and
> -Zsysv-signals flags.

Three. You forgot the emx-style signal handling. But I wasn't talking
about different signal handler philosophies. Portable programs use
sigaction() (at least they should) which is bsd-style, I guess.


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

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


Bye,
Andreas