When I wait on a specific running process group that is a child process, WIFEXITED returns true saying the process exited? Is this the way it works? Seems there is something I am not understanding....
if ( waitpid(-pgid, &pstatus, WUNTRACED|WNOHANG ) == -1)
perror("Wait error");
if ( WIFEXITED(pstatus) ) {
strncpy(buf, "Exited", buf_size);
return 0;