[PATCH 2/2] stdlib: Make abort AS-safe (BZ 26275)

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Tue Aug 1 13:52:50 GMT 2023



On 01/08/23 05:10, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> diff --git a/sysdeps/generic/internal-signals.h b/sysdeps/generic/internal-signals.h
>> index e2e9f9fd49..1c0f7b2e6c 100644
>> --- a/sysdeps/generic/internal-signals.h
>> +++ b/sysdeps/generic/internal-signals.h
>> @@ -42,7 +42,31 @@ clear_internal_signals (sigset_t *set)
>>  typedef sigset_t internal_sigset_t;
>>  
>>  #define internal_sigemptyset(__s)            __sigemptyset (__s)
>> +#define internal_sigfillset(__s)             __sigfillset (__s)
>>  #define internal_sigaddset(__s, __i)         __sigaddset (__s, __i)
>>  #define internal_sigprocmask(__h, __s, __o)  __sigprocmask (__h, __s, __o)
>>  
>> +static inline void
>> +internal_signal_block_all (internal_sigset_t *oset)
>> +{
>> +  internal_sigset_t set;
>> +  internal_sigfillset (&set);
>> +  internal_sigprocmask (SIG_BLOCK, &set, oset);
>> +}
>> +
>> +static inline void
>> +internal_signal_restore_set (const internal_sigset_t *set)
>> +{
>> +  internal_sigprocmask (SIG_SETMASK, set, NULL);
>> +}
>> +
>> +static inline void
>> +internal_signal_unblock_signal (int sig)
>> +{
>> +  internal_sigset_t set;
>> +  internal_sigemptyset (&set);
>> +  internal_sigaddset (&set, sig);
>> +  internal_sigprocmask (SIG_UNBLOCK, &set, NULL);
>> +}
>> +
>>  #endif /* __INTERNAL_SIGNALS_H  */
> 
> This should probably go into a separate patch.  I recall writing a
> similar patch, can't find it right now.

These function are not really used and only required for Hurd for the abort 
change.  I think it is more logical to add them when they are actually used
instead of a separated patch.


More information about the Libc-alpha mailing list