Next: fork.c Up: Program Listings Previous: list_c.c

fork_eg.c


/* fork_eg.c --- simple eg of fork in UNIX */

main()
{ int return_value;

  printf("Forking process\n");
  fork();
  printf("The process id is %d and return value is %d\n",getpid(),return_value);  
  execl("/bin/ls/","ls","-l",0);
  printf("This line is not printed\n");
}


Dave.Marshall@cm.cf.ac.uk
Wed Sep 14 10:06:31 BST 1994