Skip to content

Instantly share code, notes, and snippets.

@brianherman
Created August 31, 2014 23:58
Show Gist options
  • Save brianherman/56294700a559525b7d10 to your computer and use it in GitHub Desktop.
Save brianherman/56294700a559525b7d10 to your computer and use it in GitHub Desktop.
pid_t pid;
pid = fork();
if(pid < 0) {
fprintf(stderr,"Fork Failed");
exit(-1);
}else if( pid==0 ){
}
@brianherman
Copy link
Author

            for(i=0; i<pipesLength; i++){
                int status = 0;
                if(background == TRUE){
                    wait4(pids[i],&status,WNOHANG,&usage);
                }else{
                    wait4(pids[i],&status,0,&usage);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment