fork download
  1. /* main program illustrating the UNIX fork() system call.
  2. Compile using cc -o main main.c
  3. */
  4. #include <stdio.h>
  5. main() {
  6. fork();
  7. if (!fork())
  8. printf("Mon pid = %d, mon pere=%d\n", getpid(), getppid());
  9. if (fork())
  10. printf("pid=%d\n", fork());
  11. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
pid=794066
pid=0