From bfe05aa289054744b68f136b701705cfd242c4de Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 18 May 2020 17:05:05 -0300 Subject: string: Add sigabbrev_np and sigdescr_np The sigabbrev_np returns the abbreviated signal name (e.g. "HUP" for SIGHUP) while sigdescr_np returns the string describing the error number (e.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. Tested-by: Carlos O'Donell Reviewed-by: Carlos O'Donell --- sysdeps/unix/sysv/linux/x86_64/64/libc.abilist | 2 ++ sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist | 2 ++ 2 files changed, 4 insertions(+) (limited to 'sysdeps/unix/sysv/linux/x86_64') diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index 90f3c1d2f0..a077414c66 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -2073,6 +2073,8 @@ GLIBC_2.32 pthread_attr_setsigmask_np F GLIBC_2.32 pthread_getaffinity_np F GLIBC_2.32 pthread_getattr_np F GLIBC_2.32 pthread_sigmask F +GLIBC_2.32 sigabbrev_np F +GLIBC_2.32 sigdescr_np F GLIBC_2.4 __confstr_chk F GLIBC_2.4 __fgets_chk F GLIBC_2.4 __fgets_unlocked_chk F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index 8dbe6d3ed2..e2b881542c 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2170,3 +2170,5 @@ GLIBC_2.32 pthread_attr_setsigmask_np F GLIBC_2.32 pthread_getaffinity_np F GLIBC_2.32 pthread_getattr_np F GLIBC_2.32 pthread_sigmask F +GLIBC_2.32 sigabbrev_np F +GLIBC_2.32 sigdescr_np F -- cgit 1.4.1