macOS `sigaction()` handler with `SA_SIGINFO` does not include `si_pid`
问题 I'm trying to write a signal handler which needs to know the pid of the process that sends the signal. I'm having no luck with getting anything useful from the siginfo_t passed into my handler on macOS 10.14 with Xcode 10. I've reduced my code to the below minimal sample to demonstrate the issue. In this sample I spawn a child process to send the signal I want to test which is defaulted to SIGTERM , but no other signal I've tried works any better. Assuming you want to build and test this on a