/* * Sample program for fork() system call - No. 2 * * fork(2) - create a child process * * #include * #include * * pid_t fork(void); */ #include main() { int i; fork(); for (i = 0; i < 10; i++) { printf("PID = %d i = %d\n", getpid(), i); sleep(1); } }