Lingering defunct process after using execl on 5.0.6. Need help! - SCO

This is a discussion on Lingering defunct process after using execl on 5.0.6. Need help! - SCO ; Hi all. Here's the call ################################################## ######################## pid_t pid; if ( ( pid = fork() ) { printf("failed\n"); } else { if ( !pid ) { execl("execname", "execname", strVar1, strVar2, strVar3, strVar4, NULL); } } ################################################## ########################### I'm running this ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Lingering defunct process after using execl on 5.0.6. Need help!

  1. Lingering defunct process after using execl on 5.0.6. Need help!

    Hi all.

    Here's the call

    ################################################## ########################
    pid_t pid;

    if ( ( pid = fork() ) < 0 )
    {
    printf("failed\n");
    }
    else
    {
    if ( !pid )
    {
    execl("execname", "execname", strVar1, strVar2, strVar3,
    strVar4, NULL);
    }
    }

    ################################################## ###########################

    I'm running this on OpenServer 5.0.6, compiled with gcc, here's the
    version

    # gcc -v
    Reading specs from /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/2.95.2/specs
    gcc version 2.95.2 19991024 (release)


    Everything runs fine, but when the child process is done, there's
    always a "defunct" process left. And they add up and end up eating a
    lot of ressources.

    How do I fix that?

    Thank you!

    Philippe

  2. Re: Lingering defunct process after using execl on 5.0.6. Need help!

    In article <81b02cca.0310230704.770ab528@posting.google.com>,
    Philippe Hamel wrote:
    >Everything runs fine, but when the child process is done, there's
    >always a "defunct" process left. And they add up and end up eating a
    >lot of ressources.
    >
    >How do I fix that?


    Either wait for the child process in the parent or ignore SIGCHLD in the
    parent. See the wait(S), waitpid(S), signal(S), signal(M), and sigaction(S)
    man pages.

    John
    --
    John DuBois spcecdt@armory.com KC6QKZ/AE http://www.armory.com/~spcecdt/

+ Reply to Thread