[net.unix-wizards] 4.2 sigblock manual page is vague

muller@sdccsu3.UUCP (03/30/84)

The manual page for sigblock states "Signal i is blocked if the
i-th bit in mask is a 1".
So I blindly (wrongly) assumed that the following code fragment would
block SIGALRM (alarm 15):

oldmask = sigblock(1 << SIGALRM);

WRONG! That blocks SIGTERM (16) not SIGALRM (15). What the problem is that
I was counting the bits calling the least significant bit the 0th bit.
The least significant bit for the purposes of sigblock is the 1st bit.

The correct code fragment for blocking SIGALRM is:

oldmask = sigblock(1 << (SIGALRM - 1));

Keith Muller