fork(3) download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <sys/types.h>
  4.  
  5. #define BUF_SIZE 100
  6.  
  7. int main()
  8. {
  9. char buf[BUF_SIZE];
  10.  
  11. sprintf(buf,"hi");
  12. write(1, buf, strlen(buf));
  13.  
  14. fork();
  15. fork();
  16.  
  17. return 0;
  18. }
Success #stdin #stdout 0s 2152KB
stdin
Standard input is empty
stdout
hi