fork(1) download
  1. #include <stdio.h>
  2. #include <unistd.h>
  3.  
  4. int main()
  5. {
  6. int ret;
  7. ret=fork();
  8. ret=fork();
  9. ret=fork();
  10. ret=fork();
  11.  
  12. if(!ret)
  13. printf("one\n");
  14. else
  15. printf("two\n");
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
two
one
two
two