defunct processes

WPR0986%TNTECH.BITNET at cunyvm.cuny.edu WPR0986%TNTECH.BITNET at cunyvm.cuny.edu
Fri Feb 24 04:23:27 AEST 1989


In a previous article, logan at vsedev.vse.com (Jim Logan) write:
> I had to fork, call system() in the child, and then ignore SIGCLD
> in the parent to solve the problem (if I remember correctly).  I
> believe the problem is in the SCO Bourne shell since this
> does not occur on any other System V machine I've used.

The system() call waits until the process finishes before
it returns.  The proper way to do this would be to:

    signal (SIGCLD, SIGIGN);
    if (fork() == 0) {
        status = execvp (*argv, argv);
        printf ("execvp() failed: status --> %d\n", status);
    }

The parent process will never see the child process die, and
the parent process will not wait for the child process to
complete (unless you call wait() after the fork()).

I wouldn't think that the problem you had lies in the shell.

-Walter Rowe    (wpr0986 at tntech.bitnet)



More information about the Comp.unix.wizards mailing list