Created
September 30, 2015 00:38
-
-
Save jhunt/594b265f491799818173 to your computer and use it in GitHub Desktop.
Decoding Sig* fields from /proc/<PID>/status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
@sigs = qw( | |
SIGHUP SIGINT SIGQUIT SIGILL SIGTRAP | |
SIGABRT SIGBUS SIGFPE SIGKILL SIGUSR1 | |
SIGSEGV SIGUSR2 SIGPIPE SIGALRM SIGTERM | |
SIGSTKFLT SIGCHLD SIGCONT SIGSTOP SIGTSTP | |
SIGTTIN SIGTTOU SIGURG SIGXCPU SIGXFSZ | |
SIGVTALRM SIGPROF SIGWINCH SIGIO SIGPWR | |
SIGSYS | |
); | |
for (map hex, @ARGV) { | |
printf "%x:\n", $_; | |
for (my $i = 0; $i < @sigs; $i++) { | |
next if $_ & (1 << $i); | |
printf " - %s (%i)\n", $sigs[$i], $i+1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment