l***y 发帖数: 4671 | 1 程序是:
#include "stdio.h"
#include
#include
#include
#include
#include
using namespace std;
int main(){
string sIdentifier;
pid_t p1 = fork();
pid_t p2 = fork();
pid_t p3 = fork();
pid_t p4 = fork();
cout << "p1: " << p1
<< ", p2: " << p2
<< ", p3: " << p3
<< ", p4: " << p4
<
return 0;
}
结果是个全组合:
p1: 37133, p2: 37134, p3: 37135, p4: 37138
p1: 37133, p2: 37134, p3: 37135, p4: 0
p1: 37133, p2: 371... 阅读全帖 |
|