Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux signal masks - what do they mean though?

Tags:

linux

signals

How can you store 32 signals inside a 16 bit mask?

SigPnd: 0000000000000000
ShdPnd: 0000000000004000
SigBlk: 0000010000017003
SigIgn: 0000000000381000

How do I interpret the SigIgn for example? I read the proc documentation but I don't get how to interpret what the actual bits mean.

like image 969
user622469 Avatar asked Feb 15 '23 23:02

user622469


1 Answers

Not sure where you got the "32 signals inside a 16 bit mask" information from but it is wrong as far as I know.

Assuming each line is hex then each line is 8 bytes or 64 bits. The lower 4 bytes (32 bits) are standard signals. The upper 32 bits are posix realtime signals. (It's actually a little more convoluted than that - see man (7) signal and SIGRTMAX and SIGRTMIN for the low down.)

So in the SigIgn mask you asked about everything is off but a couple of things in the lower 3 bytes: 38 10 00. In the lowest order byte, 00, no signals are ignored. In the next byte, the hex 10 converts to 00010000 in binary. So the 5th bit in that byte is on. Likewise hex 38 converts to binary 00111000. Putting the 3 bytes together as a string of binary we get:

001110000001000000000000

So counting from the right we can see that bits 13 20 21 22 are ON and therefore ignored. If you go back to man (7) signal you can see the table for the signal values. The values are broken down by architecture so, assuming you are on a ix86 machine, the signal values represent that SIGPIPE, SIGTSTP, SIGTTIN and SIGTTOU signals are being ignored.

like image 114
Duck Avatar answered Feb 18 '23 13:02

Duck