[PATCH 4/4] signal: Only handle on NSIG signals on signal functions (BZ #25657)

Adhemerval Zanella adhemerval.zanella@linaro.org
Tue Apr 21 14:36:25 GMT 2020



On 21/04/2020 11:35, Florian Weimer wrote:
> * Adhemerval Zanella:
> 
>> On 21/04/2020 11:07, Florian Weimer wrote:
>>> * Adhemerval Zanella:
>>>
>>>> On 21/04/2020 10:47, Florian Weimer wrote:
>>>>> * Adhemerval Zanella:
>>>>>
>>>>>> On 21/04/2020 10:14, Florian Weimer wrote:
>>>>>> Only handle __NSIG_WORDS on linux sigsetopts.h instead of _SIGSET_NWORDS
>>>>>> when manipulating sigset_t masks.
>>>>>
>>>>> Hmm.  __NSIG_WORDS is defined like this:
>>>>>
>>>>>> +# define __NSIG_WORDS (_NSIG / (8 * sizeof (unsigned long int )))
>>>>>
>>>>> This gives us two words for _NSIG == 65.  Is this correct?
>>>>
>>>> Two words (32-bits) for all 64-bit architectures,
>>>
>>> sizeof (unsigned long int) is 8 on 64-bit.  65 / (8 * 8) is 1.
>>>
>>> I assume that for _NSIG == 65, the signal numbers from 0 to 64 are all
>>> valid and can be manipulated using sigaddset etc.  This suggests to me
>>> that we need three 32-bit longs and two 64-bit longs.
>>
>> Indeed my mistake here, I was reading the value as the required words
>> the maximum accessed index.
> 
> Ahh.  Please put also a comment into sigsetops.h how this is supposed
> to work, that is, which signal numbers are expected to be valid.
> 

Alright. I will do it.


More information about the Libc-alpha mailing list