Guest User

Untitled

a guest
Feb 23rd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. main(int argc, char *argv[])
  4. {
  5. int childpid;
  6. childpid=fork();
  7.  
  8. if (childpid<0)
  9. {
  10. printf("Something wrong in the fork. \n");
  11. return 0;
  12. }
  13.  
  14. if (childpid==0)
  15. {
  16. /*child process routine*/
  17. printf("This is the child proces.\n");
  18. }
  19.  
  20. else
  21. {
  22. /*parent process routine*/
  23. printf("This is the parent process.\n");
  24. }
  25. }
Add Comment
Please, Sign In to add comment