Hello,
I'm trying to create a child process and waitpid() on a parent process that's running in background. But when I check the process list, child process is 'defunct':
Code:[...] int *stat = NULL; proc_id = fork(); if(proc_id == 0) execl(path_to_proc, name_of_proc, NULL) else if(proc_id>0) waitpid(proc_id, stat, WNOHANG) [...]
Any thoughts?