摘要:
曾经觉得费解,温故知新一下:/*g++ -o New0001 New0001.cpp */#include <stdio.h>#include <sys/wait.h>#include <sys/types.h>#include <unistd.h>int main(void){ pid_t pid; if ((pid = fork()) < 0) { fprintf(stderr,"Fork error!\n"); exit(-1); } else if (pid == 0) /* first child */ { i 阅读全文