How can I tell whether SIGILL originated from an illegal instruction or from kill -ILL?
问题 In a signal handler installed through void (*sa_sigaction)(int, siginfo_t *, void *); , how can I tell whether a SIGILL originated from an illegal instruction or from some process having sent SIGILL? I looked at si_pid of siginfo_t, but this seems to be uninitialized in case an illegal instruction was encountered, so that I can't base my decision on it. - Of course, I'm searching for a preferably simple and portable solution, rather than reading the instruction code at si_addr and trying to