/proc/<pid>status SigIGN field
Is ther开发者_开发知识库e any URL where i can some information about /proc//status. Specially the following fields.
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000000000000
SigCgt: 0000000000000000
Or can someone give some pointer to it?.
Man proc(5)
documents all of these entries.
From the manpage on my system, which is more comprehensive than some online versions I've seen (this one's better):
- SigPnd, ShdPnd: Number of signals pending for thread and for process as a whole (see pthreads(7) and signal(7)).
- SigBlk, SigIgn, SigCgt: Masks indicating signals being blocked, ignored, and caught (see signal(7)). ockquote
Essentially they're counts and bitmasks of the signals which are waiting to be delivered (i.e. have been sent, but not received) to the process or thread in question and the signals which are being blocked/ignored/delivered.
To decode the bit list of signals, I am using:
[mvutcovi@mvutcovi-lap2 ~]$ cat signals.sh
#read -p "PID=" pid
pid=$1
cat /proc/$pid/status|egrep '(Sig|Shd)(Pnd|Blk|Ign|Cgt)'|while read name mask;do
bin=$(echo "ibase=16; obase=2; ${mask^^*}"|bc)
echo -n "$name $mask $bin "
i=1
while [[ $bin -ne 0 ]];do
if [[ ${bin:(-1)} -eq 1 ]];then
kill -l $i | tr '\n' ' '
fi
bin=${bin::-1}
set $((i++))
done
echo
done
# vim:et:sw=4:ts=4:sts=4:
精彩评论