[PATCH 12/13] string: Add sigabbrev_np and sigdescr_np

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Jun 3 16:39:28 GMT 2020



On 28/05/2020 09:31, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
> 
>> The sigabbrev_np returns the abbreviated signal name (i.g. "HUP" for
>> SIGHUP) while sigdescr_np returns string describing error number
>> (i.g "Hangup" for SIGHUP).  Different than strsignal, sigdescr_np
>> does not attempt to translate the return description and both
>> functions return NULL for an invalid signal number.
>>
>> They should be used instead of sys_siglist or sys_sigabbrev and they
>> are both thread and async-signal safe.  They are added as GNU
>> extensions on string.h header (same as strsignal).
>>
>> Checked on x86-64-linux-gnu, i686-linux-gnu, powerpc64le-linux-gnu,
>> and s390x-linux-gnu.
> 
> Most of my comments on the errno version of this patch apply here as
> well.
> 
> If the non-localized names are useful, should we add strsignal_l to
> capture that?

As for sys_err related functions, both symbols are added to provided
async-signal safe functions to supply the sys_siglist/sys_sigabbrev
deprecation (and it is way simpler than define a extra global C locale
though).


More information about the Libc-alpha mailing list