B线是什么意思?我将进程分叉 10 次,显示进程 ID,然后调用wait()
10 次。
#include <stdio.h>
#include <unistd.h>
// Fork the process 10 times
for(i = 0; i < 10; i++) {
// Catch the PID
if (pid = fork() < 0)
// error
else if (pid == 0) {
function_A();
return 0;
}
printf(“process ID: %d \n”, pid); // Line A
}
for(i = 0; i < 10; i++) //Line B
wait();