[프로그래밍] fork 는 프로세스를 복제하는 함수입니다.
/* runls3 -- run ls in a subprocess */main(){int pid;printf("Parent pid of a.out: %d\n", getppid());pid = fork(); /* code for parent process */if (pid > 0 ) {wait((int *)0); /* wait for completion of child process */printf("\nParent process id: %d, parent pid: %d, ls completed\n", getpid(), getppid());exit(0);} /* code for child process */if (pid == 0) {printf("Child process id: %d, parent pid: ..