From 68d4c1d4edd609c4b868cdacbbdf547b82f7be52 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 17 Sep 2018 13:55:33 -0600 Subject: [PATCH] C library: Add some new functions defined in POSIX.1-2017: stpncpy(), strsignal(), psignal(), psiginfo(). --- include/signal.h | 46 ++--- include/string.h | 2 + libs/libc/signal/Make.defs | 4 +- libs/libc/signal/sig_psignal.c | 124 +++++++++++++ libs/libc/signal/{signal.c => sig_signal.c} | 2 +- libs/libc/signal/{sigwait.c => sig_wait.c} | 2 +- libs/libc/string/Make.defs | 18 +- libs/libc/string/lib_stpncpy.c | 100 +++++++++++ libs/libc/string/lib_strncpy.c | 36 +++- libs/libc/string/lib_strsignal.c | 185 ++++++++++++++++++++ 10 files changed, 482 insertions(+), 37 deletions(-) create mode 100644 libs/libc/signal/sig_psignal.c rename libs/libc/signal/{signal.c => sig_signal.c} (99%) rename libs/libc/signal/{sigwait.c => sig_wait.c} (99%) create mode 100644 libs/libc/string/lib_stpncpy.c create mode 100644 libs/libc/string/lib_strsignal.c diff --git a/include/signal.h b/include/signal.h index e96120b48d..8c522e8c84 100644 --- a/include/signal.h +++ b/include/signal.h @@ -370,33 +370,35 @@ extern "C" #define EXTERN extern #endif -int kill(pid_t pid, int signo); -int raise(int signo); -int sigaction(int signo, FAR const struct sigaction *act, - FAR struct sigaction *oact); -int sigaddset(FAR sigset_t *set, int signo); -int sigdelset(FAR sigset_t *set, int signo); -int sigemptyset(FAR sigset_t *set); -int sigfillset(FAR sigset_t *set); -int sighold(int signo); -int sigismember(FAR const sigset_t *set, int signo); -int sigignore(int signo); +int kill(pid_t pid, int signo); +void psignal(int signum, FAR const char *message); +void psiginfo(FAR const siginfo_t *pinfo, FAR const char *message); +int raise(int signo); +int sigaction(int signo, FAR const struct sigaction *act, + FAR struct sigaction *oact); +int sigaddset(FAR sigset_t *set, int signo); +int sigdelset(FAR sigset_t *set, int signo); +int sigemptyset(FAR sigset_t *set); +int sigfillset(FAR sigset_t *set); +int sighold(int signo); +int sigismember(FAR const sigset_t *set, int signo); +int sigignore(int signo); _sa_handler_t signal(int signo, _sa_handler_t func); -int sigpause(int signo); -int sigpending(FAR sigset_t *set); -int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); +int sigpause(int signo); +int sigpending(FAR sigset_t *set); +int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); #ifdef CONFIG_CAN_PASS_STRUCTS -int sigqueue(int pid, int signo, union sigval value); +int sigqueue(int pid, int signo, union sigval value); #else -int sigqueue(int pid, int signo, FAR void *sival_ptr); +int sigqueue(int pid, int signo, FAR void *sival_ptr); #endif -int sigrelse(int signo); +int sigrelse(int signo); _sa_handler_t sigset(int signo, _sa_handler_t func); -int sigwait(FAR const sigset_t *set, FAR int *sig); -int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *value, - FAR const struct timespec *timeout); -int sigsuspend(FAR const sigset_t *sigmask); -int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value); +int sigwait(FAR const sigset_t *set, FAR int *sig); +int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *value, + FAR const struct timespec *timeout); +int sigsuspend(FAR const sigset_t *sigmask); +int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value); #undef EXTERN #ifdef __cplusplus diff --git a/include/string.h b/include/string.h index f3dbc2aaf6..2bf5c25f8b 100644 --- a/include/string.h +++ b/include/string.h @@ -75,6 +75,7 @@ int strcoll(FAR const char *, FAR const char *s2); FAR char *strcpy(FAR char *dest, FAR const char *src); FAR char *stpcpy(FAR char *dest, FAR const char *src); FAR char *strncpy(FAR char *, FAR const char *, size_t); +FAR char *stpncpy(FAR char *, FAR const char *, size_t); FAR char *strpbrk(FAR const char *, FAR const char *); FAR char *strchr(FAR const char *s, int c); FAR char *strrchr(FAR const char *s, int c); @@ -82,6 +83,7 @@ size_t strspn(FAR const char *, FAR const char *); size_t strcspn(FAR const char *, FAR const char *); FAR char *strstr(FAR const char *, FAR const char *); FAR char *strcasestr(FAR const char *, FAR const char *); +FAR char *strsignal(int signum); FAR char *strtok(FAR char *, FAR const char *); FAR char *strtok_r(FAR char *, FAR const char *, FAR char **); size_t strxfrm(FAR char *, FAR const char *, size_t n); diff --git a/libs/libc/signal/Make.defs b/libs/libc/signal/Make.defs index ce6335866e..7cf5891f35 100644 --- a/libs/libc/signal/Make.defs +++ b/libs/libc/signal/Make.defs @@ -38,8 +38,8 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y) # Add the signal C files to the build CSRCS += sig_addset.c sig_delset.c sig_emptyset.c sig_fillset.c -CSRCS += sig_hold.c sig_ignore.c sig_ismember.c sig_pause.c sig_raise.c -CSRCS += sig_relse.c sig_set.c signal.c sigwait.c +CSRCS += sig_hold.c sig_ignore.c sig_ismember.c sig_pause.c sig_psignal.c +CSRCS += sig_raise.c sig_relse.c sig_set.c sig_signal.c sig_wait.c # Add the signal directory to the build diff --git a/libs/libc/signal/sig_psignal.c b/libs/libc/signal/sig_psignal.c new file mode 100644 index 0000000000..48355f688d --- /dev/null +++ b/libs/libc/signal/sig_psignal.c @@ -0,0 +1,124 @@ +/**************************************************************************** + * libs/libc/signal/sig_psignal.c + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +/* Uses streams... not available to kernel code */ + +#ifndef __KERNEL__ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: psignal + * + * Description: + * The psignal() functions will write a language-dependent message + * associated with a signal number to the standard error stream as + * follows: + * + * First, if message is not a null pointer and is not the empty string, + * the string pointed to by the message argument will be written, + * followed by a colon and a space. + * + * Then the signal description string associated with signum or with the + * signal indicated by pinfo will be written, followed by a newline. + * + * Returned Value + * None. The errno value is never set in this implementation. + * + ****************************************************************************/ + +void psignal(int signum, FAR const char *message) +{ + /* For now, just a brainless write to stderr (fd == 2). C buffered I/O is + * used! + */ + + if (message != NULL) + { + (void)fprintf(stderr, "%s: %s\n", strsignal(signum)); + } + else + { + (void)fprintf(stderr, "%s\n", strsignal(signum)); + } +} + +/**************************************************************************** + * Name: psiginfo + * + * Description: + * The psiginfo() functions will write a language-dependent message + * associated with a signal number to the standard error stream as + * follows: + * + * First, if message is not a null pointer and is not the empty string, + * the string pointed to by the message argument will be written, + * followed by a colon and a space. + * + * Then the signal description string associated with signum or with the + * signal indicated by pinfo will be written, followed by a newline. + * + * Returned Value + * None. Since no value is returned, an application wishing to check for + * error situations should set errno to 0, then call psiginfo() then check + * errno. + * + ****************************************************************************/ + +void psiginfo(FAR const siginfo_t *pinfo, FAR const char *message) +{ + if (pinfo == NULL) + { + set_errno(EINVAL); + } + else + { + psignal(pinfo->si_signo, message); + } +} + +#endif /* __KERNEL__ */ diff --git a/libs/libc/signal/signal.c b/libs/libc/signal/sig_signal.c similarity index 99% rename from libs/libc/signal/signal.c rename to libs/libc/signal/sig_signal.c index 30a2215e0b..b645f65849 100644 --- a/libs/libc/signal/signal.c +++ b/libs/libc/signal/sig_signal.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libc/signal/signal.c + * libs/libc/signal/sig_signal.c * * Copyright (C) 2015-2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/libs/libc/signal/sigwait.c b/libs/libc/signal/sig_wait.c similarity index 99% rename from libs/libc/signal/sigwait.c rename to libs/libc/signal/sig_wait.c index d50fb07e73..4dbada5b13 100644 --- a/libs/libc/signal/sigwait.c +++ b/libs/libc/signal/sig_wait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * libs/libc/signal/sigwait.c + * libs/libc/signal/sig_wait.c * * Copyright (C) 2017 Gregory Nutt. All rights reserved. * Author: Gregory Nutt diff --git a/libs/libc/string/Make.defs b/libs/libc/string/Make.defs index bc50bf81e0..550bb39ae5 100644 --- a/libs/libc/string/Make.defs +++ b/libs/libc/string/Make.defs @@ -38,13 +38,13 @@ CSRCS += lib_ffs.c lib_ffsl.c lib_ffsll.c lib_fls.c lib_flsl.c CSRCS += lib_flsll.c lib_isbasedigit.c lib_memset.c lib_memchr.c CSRCS += lib_memccpy.c lib_memcmp.c lib_memmove.c lib_skipspace.c -CSRCS += lib_stpcpy.c lib_strcasecmp.c lib_strcat.c lib_strchr.c -CSRCS += lib_strcpy.c lib_strcmp.c lib_strcspn.c lib_strdup.c -CSRCS += lib_strerror.c lib_strlen.c lib_strnlen.c lib_strncasecmp.c -CSRCS += lib_strncat.c lib_strncmp.c lib_strncpy.c lib_strndup.c -CSRCS += lib_strcasestr.c lib_strpbrk.c lib_strrchr.c lib_strspn.c -CSRCS += lib_strstr.c lib_strtok.c lib_strtokr.c lib_strerrorr.c -CSRCS += lib_explicit_bzero.c +CSRCS += lib_stpcpy.c lib_stpncpy.c lib_strcasecmp.c lib_strcat.c +CSRCS += lib_strchr.c lib_strcpy.c lib_strcmp.c lib_strcspn.c +CSRCS += lib_strdup.c lib_strerror.c lib_strlen.c lib_strnlen.c +CSRCS += lib_strncasecmp.c lib_strncat.c lib_strncmp.c lib_strncpy.c +CSRCS += lib_strndup.c lib_strcasestr.c lib_strpbrk.c lib_strrchr.c +CSRCS += lib_strspn.c lib_strstr.c lib_strtok.c lib_strtokr.c +CSRCS += lib_strerrorr.c lib_explicit_bzero.c ifneq ($(CONFIG_LIBC_ARCH_MEMCPY),y) ifeq ($(CONFIG_MEMCPY_VIK),y) @@ -58,6 +58,10 @@ ifeq ($(CONFIG_LIBC_LOCALE),y) CSRCS += lib_strcoll.c lib_strxfrm.c endif +ifneq ($(CONFIG_DISABLE_SIGNALS),y) +CSRCS += lib_strsignal.c +endif + # Add the string directory to the build DEPPATH += --dep-path string diff --git a/libs/libc/string/lib_stpncpy.c b/libs/libc/string/lib_stpncpy.c new file mode 100644 index 0000000000..83daaadec2 --- /dev/null +++ b/libs/libc/string/lib_stpncpy.c @@ -0,0 +1,100 @@ +/**************************************************************************** + * libs/libc/string/lib_stpncpy.c + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: strncpy + * + * Description: + * Copies the string pointed to by 'src' (including the terminating NUL + * character) into the array pointed to by 'dest'. strncpy() will not + * copy more than 'n' bytes from 'src' to 'dest' array (including the + * NUL terminator). + * + * If the array pointed to by 'src' is a string that is shorter than 'n' + * bytes, NUL characters will be appended to the copy in the array + * pointed to by 'dest', until 'n' bytes in all are written. + * + * If copying takes place between objects that overlap, the behavior is + * undefined. + * + * Returned Value: + * If a NUL character is written to the destination, the stpncpy() + * function will return the address of the first such NUL character. + * Otherwise, it will return &dest[n] + * + ****************************************************************************/ + +#ifndef CONFIG_LIBC_ARCH_STRNCPY +FAR char *strncpy(FAR char *dest, FAR const char *src, size_t n) +{ + FAR char *end = dest + n; /* End of dest buffer + 1 byte */ + FAR char *ret; /* Value to be returned */ + + /* Copy up n bytes, breaking out of the loop early if a NUL terminator is + * encountered. + */ + + while ((dest != end) && (*dest++ = *src++) != '\0') + { + } + + /* Return the pointer to the NUL terminator (or to the end of the buffer + * + 1. + */ + + ret = dest; + + /* Pad the remainder of the array pointer to 'dest' with NULs */ + + while (dest != end) + { + *dest++ = '\0'; + } + + return ret; +} +#endif diff --git a/libs/libc/string/lib_strncpy.c b/libs/libc/string/lib_strncpy.c index 317a105300..b0263524eb 100644 --- a/libs/libc/string/lib_strncpy.c +++ b/libs/libc/string/lib_strncpy.c @@ -47,15 +47,43 @@ /**************************************************************************** * Name: strncpy + * + * Description: + * Copies the string pointed to by 'src' (including the terminating NUL + * character) into the array pointed to by 'dest'. strncpy() will not + * copy more than 'n' bytes from 'src' to 'dest' array (including the + * NUL terminator). + * + * If the array pointed to by 'src' is a string that is shorter than 'n' + * bytes, NUL characters will be appended to the copy in the array + * pointed to by 'dest', until 'n' bytes in all are written. + * + * If copying takes place between objects that overlap, the behavior is + * undefined. + * + * Returned Value: + * The strncpy() function returns the pointer to 'dest' + * ****************************************************************************/ #ifndef CONFIG_LIBC_ARCH_STRNCPY -char *strncpy(FAR char *dest, FAR const char *src, size_t n) +FAR char *strncpy(FAR char *dest, FAR const char *src, size_t n) { - char *ret = dest; /* Value to be returned */ - char *end = dest + n; /* End of dest buffer + 1 byte */ + FAR char *ret = dest; /* Value to be returned */ + FAR char *end = dest + n; /* End of dest buffer + 1 byte */ + + /* Copy up n bytes, breaking out of the loop early if a NUL terminator is + * encountered. + */ + + while ((dest != end) && (*dest++ = *src++) != '\0') + { + } + + /* Note that there may be no NUL terminator in 'dest' */ + + /* Pad the remainder of the array pointer to 'dest' with NULs */ - while ((dest != end) && (*dest++ = *src++) != '\0'); while (dest != end) { *dest++ = '\0'; diff --git a/libs/libc/string/lib_strsignal.c b/libs/libc/string/lib_strsignal.c new file mode 100644 index 0000000000..53b3b544d2 --- /dev/null +++ b/libs/libc/string/lib_strsignal.c @@ -0,0 +1,185 @@ +/**************************************************************************** + * libs/libc/string/lib_strsignal.c + * + * Copyright (C) 2018 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* We don't know what signals names will be assigned to which signals in + * advance and we do not want to return a volatile value. One solution is + * this silly array of useless names: + */ + +static FAR const char *g_default_sigstr[32] = +{ + "Signal 0", + "Signal 1", + "Signal 2", + "Signal 3", + "Signal 4", + "Signal 5", + "Signal 6", + "Signal 7", + "Signal 8", + "Signal 9", + "Signal 10", + "Signal 11", + "Signal 12", + "Signal 13", + "Signal 14", + "Signal 15", + "Signal 16", + "Signal 17", + "Signal 18", + "Signal 19", + "Signal 20", + "Signal 21", + "Signal 22", + "Signal 23", + "Signal 24", + "Signal 25", + "Signal 26", + "Signal 27", + "Signal 28", + "Signal 29", + "Signal 30", + "Signal 31", +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: psignal + * + * Description: + * The strsignal() function will map the signal number in signum to an + * implementation-defined string and will return a pointer to it. + * + ****************************************************************************/ + +FAR char *strsignal(int signum) +{ + /* Handle invalid signals */ + + if (!GOOD_SIGNO(signum)) + { + return (FAR char *)"Invalid Signal"; + } + + /* Handle named signals */ + + switch (signum) + { + /* Standard signals */ + +#ifdef SIGUSR1 + case SIGUSR1: + return (FAR char *)"SIGUSR1"; +#endif + +#ifdef SIGUSR2 + case SIGUSR2: + return (FAR char *)"SIGUSR2"; +#endif + +#ifdef SIGALRM + case SIGALRM: + return (FAR char *)"SIGALRM"; +#endif + +#ifdef SIGCHLD + case SIGCHLD: + return (FAR char *)"SIGCHLD"; +#endif + +#ifdef SIGPOLL + case SIGPOLL: + return (FAR char *)"SIGPOLL"; +#endif + +#ifdef SIGSTOP + case SIGSTOP: + return (FAR char *)"SIGSTOP"; +#endif + +#ifdef SIGSTP + case SIGSTP: + return (FAR char *)"SIGSTP"; +#endif + +#ifdef SIGCONT + case SIGCONT: + return (FAR char *)"SIGCONT"; +#endif + +#ifdef SIGKILL + case SIGKILL: + return (FAR char *)"SIGKILL"; +#endif + +#ifdef SIGINT + case SIGINT: + return (FAR char *)"SIGINT"; +#endif + + /* Non-standard signals */ + +#ifdef SIGCONDTIMEDOUT + case SIGCONDTIMEDOUT: + return (FAR char *)"SIGCONDTIMEDOUT"; +#endif + +#ifdef SIGWORK + case SIGWORK: + return (FAR char *)"SIGWORK"; +#endif + + default: + break; + } + + /* Return a string devoid is meaning */ + + return (FAR char *)g_default_sigstr[signum]; +}