Will wait and waitpid block SIGCHLD and unblock it when they return in Linux?
问题 Here is my code to examine this: void handler(int n) { printf("handler %d\n", n); int status; if (wait(&status) < 0) printf("%s\n", strerror(errno)); } int main() { struct sigaction sig; sigemptyset(&sig.sa_mask); sig.sa_handler = handler; sig.sa_flags = 0; sig.sa_restorer = NULL; struct sigaction sigold; sigaction(SIGCHLD, &sig, &sigold); pid_t pid; int status; printf("before fork\n"); if ((pid = fork()) == 0) { _exit(127); } else if (pid > 0) { printf("before waitpid\n"); if (waitpid(pid,