编译运行后为什么会产生两个“ls -l”
figure922@JeffyPC:~/homework/6.5.1$ ./multi_proc_wrong
In father process: In child1:execute 'ls -l'
In child1:execute 'ls -l'
In child2: sleep for 5 seconds and then exit
总用量 32
总用量 32
-rwxr-xr-x 1 figure922 figure922 8820 12月 4 16:27 multi_proc
-rwxr-xr-x 1 figure922 figure922 8820 12月 4 16:27 multi_proc
-rw-r--r-- 1 figure922 figure922 1096 12月 4 16:24 multi_proc.c
-rwxr-xr-x 1 figure922 figure922 8826 12月 4 14:50 multi_proc_wrong
-rw-r--r-- 1 figure922 figure922 1100 12月 4 14:50 multi_proc_wrong.c
-rw-r--r-- 1 figure922 figure922 1096 12月 4 16:24 multi_proc.c
-rwxr-xr-x 1 figure922 figure922 8826 12月 4 14:50 multi_proc_wrong
-rw-r--r-- 1 figure922 figure922 1100 12月 4 14:50 multi_proc_wrong.c
Get child1 exit code
The child2 process has not exited!
The child2 process has not exited!
The child2 process has not exited!
The child2 process has not exited!
The child2 process has not exited!
Get child2 exit code