Handling SIGCHLD, how to record the return values of children as they die
问题 void childSignalHandler(int signo) { int status; pid_t pid = wait(&status); struct PIDList* record = getRecordForPID(childlist, pid); if (record != NULL) record->returnValue = status; } Quick question: I want this handler to, when a child dies (this app spawns lots of children), get their return value and record it (last three lines). Will this do it, or am I getting all this API business wrong? Thank you for your time! (also, linux API terminology is creepy as hell, check for dying children