Re: RFC: 'more signals' patch, 2.1.33

Ulrich Drepper (drepper@myware.rz.uni-karlsruhe.de)
16 Apr 1997 01:23:10 +0200


Richard Henderson <richard@stommel.tamu.edu> writes:

> libc.so contains:
>
> sigaction@1024 -- a version of sigaction that uses
> 1024-bit sigset_t
> sigaction@2048 -- you get the idea
>
> bar:
>
> Uses sigaction@2048 to set up SIGLOSE.
>
> libfoo.so:
>
> Uses sigaction@1024 to momentarily save and restore
> signal state of SIGLOSE.
>
> You've just lost the top 1024 bits of SIGLOSE's sa_mask, and there's
> nothing to be done about it in libc, because there's no place to
> store the extra bits.

This can be easily solved by making the two sigaction implementations
(and more general: all signal handling functions) aware of each other.
One could simply add some code like:

int
sigaction@1024 (int sig, const struct sigaction *act,
struct sigaction *oact)
{
int initialized = PTHREAD_ONCE_INIT;

pthread_once (&initialized, init_1024);

if (__max_sigset_size < 1024)
__libc_fatal ("I cannot stand this...");

...
}

int
sigaction@2048 (int sig, const struct sigaction *act,
struct sigaction *oact)
{
int initialized = PTHREAD_ONCE_INIT;

pthread_once (&initialized, init_2048);

if (__max_sigset_size < 2048)
__libc_fatal ("I cannot stand this...");

...
}

where init_1024 and init_2048 initialize the global variable
__max_sigset_size to the appropriate number.

-- Uli
---------------. drepper@cygnus.com ,-. Rubensstrasse 5
Ulrich Drepper \ ,-------------------' \ 76149 Karlsruhe/Germany
Cygnus Solutions `--' drepper@gnu.ai.mit.edu `------------------------