Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- main(int argc, char *argv[])
- {
- int childpid;
- childpid=fork();
- if (childpid<0)
- {
- printf("Something wrong in the fork. \n");
- return 0;
- }
- if (childpid==0)
- {
- /*child process routine*/
- printf("This is the child proces.\n");
- }
- else
- {
- /*parent process routine*/
- printf("This is the parent process.\n");
- }
- }
Add Comment
Please, Sign In to add comment