Subj : Re: threaded program and wait() call To : comp.programming.threads From : tadek Date : Tue Aug 09 2005 12:02 pm Hello Patrick, I have solved it! And the solution was quite simple: 1) program was using old-fashioned, deprecated signal() call to install signal handler 2)gcc defaults sigaction's sa_flags to SA_RESTART on my RHEL4!!! 3) it means when wait() is interrupted it does not return EINTR error code 4) solution: use sigaction() instead of signal() and initialize sigaction structure (fill it with zeroes) 5) alternative is to use Feature Test Macros. "when you don't specify with sigaction what a particular handler should do, it uses a default choice. The default choice in the GNU library depends on the feature test macros you have defined. If you define _BSD_SOURCE or _GNU_SOURCE before calling signal, the default is to resume primitives" Bottom line is that man page for waitpid()/wait() is not very precise. Your comment about posix_spawn() is very valid and I will take your advise. Thank you for your help. Usefull links: Process Completion http://www.gnu.org/software/libc/manual/html_node/Process-Completion.html#Process-Completion Primitives Interrupted by Signals: http://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html#Interrupted-Primitives .