in reply to Understanding fork + wait

Hi,

my gut feeling tells me that this has something to do with the fact that system() is basically fork and exec while the parent (in your case, the child :-° ) wait()s. The wait() returns with your "No child process" error.

Interlude while Robartes checks the man page for wait

Eureka. The man page for wait() states that wait returns ECHILD..

...if the process specified in pid does not exist or is not a child of the calling process. (This can happen for one's own child if the action for SIGCHLD is set to SIG_IGN. See also the NOTES sec- tion about threads.)

This is on a Linux system with glibc v2.2, so YMMV.

CU
Robartes-