How does wait(NULL) exactly work?
问题 If i use wait(null) , and i know (for sure) that the child will finish (exit) before we reach to wait(null) in the parent process , does the wait(null) block the parent process ?? I mean , the wait() won't get any signal right ? int main() { int pipe_descs[2] ; int i, n, p ; srand(time(NULL( ; pipe(pipe_descs) ; for (i = 0; i < 2; i++) { pid_t status = fork() ; if (status == 0) { n = rand() % 100; p = (int) getpid() ; write(pipe_descs[1], &n, sizeof(int)) ; write(pipe_descs[1], &p, sizeof(int