Using fork() in simplest form need to hit enter to finish execution
问题 I want to run some simple example to find out how fork() system call work. Its work but need to hit enter to exit the program after printing child process . #include <stdio.h> #include <unistd.h> int main() { pid_t pid; pid = fork(); if(pid == 0){ printf("child process\n"); } else{ printf("parent process\n"); } return 0; } compile, run & output ss@ss:~$ gcc dd.c -o dd ss@ss:~$ ./dd parent process ss@ss:~$ child process after print child process on screen program need to hit enter key to