Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int status;
- if ( waitpid(pid, &status, 0) == -1 ) {
- perror("waitpid failed");
- return EXIT_FAILURE;
- }
- if ( WIFEXITED(status) ) {
- // final result
- const int es = WEXITSTATUS(status);
- printf("Exit status for %d(words in the sentence): %d\n Final result: ", pid, es);
- char c;
- int r;
- while((r = read(pfd4[0], &c, 1))>0)
- {
- printf("%c", c);
- }
- printf("\n");
- }
- close(pfd4[0]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement