Linux has process accounting -- acct(5).
If you turn it on, e.g., with the accton
command, Linux will record some process info into a file each time a process exits. The info does record signal deaths int the ac_flags
field (though this doesn't distinguish the signal that caused the deatH) and it looks like you could get the complete exit information (as from wait(2)) from the ac_exitcode
field. Unfortunately the shipped dump-acct
command isn't showing it, but I suppose you could show it if you parsed the file from C.
Apart form this feature, in a basic UNIX POSIX system, only process parents can get the exit information their child (ptrace
too, but ptrace
-based tracers sort of act like a second parent).