From 325081b9eb2035f8f025255206889208f330b590 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 18 May 2020 17:41:25 -0300 Subject: string: Add strerrorname_np and strerrordesc_np The strerrorname_np returns error number name (e.g. "EINVAL" for EINVAL) while strerrordesc_np returns string describing error number (e.g "Invalid argument" for EINVAL). Different than strerror, strerrordesc_np does not attempt to translate the return description, both functions return NULL for an invalid error number. They should be used instead of sys_errlist and sys_nerr, both are thread and async-signal safe. These functions are GNU extensions. 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 --- string/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'string/Makefile') diff --git a/string/Makefile b/string/Makefile index 8fe7e17fe2..f8d3104e16 100644 --- a/string/Makefile +++ b/string/Makefile @@ -45,7 +45,8 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \ envz basename \ strcoll_l strxfrm_l string-inlines memrchr \ xpg-strerror strerror_l explicit_bzero \ - sigdescr_np sigabbrev_np + sigdescr_np sigabbrev_np strerrorname_np \ + strerrordesc_np strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \ stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ -- cgit v1.2.3