pkarashchenko commented on code in PR #8867:
URL: https://github.com/apache/nuttx/pull/8867#discussion_r1143965838


##########
libs/libc/string/lib_strsignal.c:
##########
@@ -96,80 +69,51 @@ FAR char *strsignal(int signum)
 
   switch (signum)
     {
+#ifdef CONFIG_LIBC_STRSIGNAL
       /* 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 SIGTSTP
-      case SIGTSTP:
-        return (FAR char *)"SIGTSTP";
-#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
-
-#ifdef SIGQUIT
-      case SIGQUIT:
-        return (FAR char *)"SIGQUIT";
-#endif
-
-#ifdef SIGTERM
-      case SIGTERM:
-        return (FAR char *)"SIGTERM";
-#endif
+      CASE_SIG_STR(SIGHUP,    "Hangup");
+      CASE_SIG_STR(SIGINT,    "Interrupt");
+      CASE_SIG_STR(SIGQUIT,   "Quit");
+      CASE_SIG_STR(SIGILL,    "Illegal instruction");
+      CASE_SIG_STR(SIGTRAP,   "Trace/breakpoint trap");
+      CASE_SIG_STR(SIGABRT,   "Aborted");
+      CASE_SIG_STR(SIGBUS,    "Bus error");
+      CASE_SIG_STR(SIGFPE,    "Arithmetic exception");
+      CASE_SIG_STR(SIGKILL,   "Killed");
+      CASE_SIG_STR(SIGUSR1,   "User defined signal 1");
+      CASE_SIG_STR(SIGSEGV,   "Invalid memory reference");
+      CASE_SIG_STR(SIGUSR2,   "User defined signal 2");
+      CASE_SIG_STR(SIGPIPE,   "Broken pipe");
+      CASE_SIG_STR(SIGALRM,   "Alarm clock");
+      CASE_SIG_STR(SIGTERM,   "Terminated");
+      CASE_SIG_STR(SIGCHLD,   "Child status changed");
+      CASE_SIG_STR(SIGCONT,   "Continued");
+      CASE_SIG_STR(SIGSTOP,   "Stopped (signal)");
+      CASE_SIG_STR(SIGTSTP,   "Stopped");
+      CASE_SIG_STR(SIGTTIN,   "Stopped (tty input)");
+      CASE_SIG_STR(SIGTTOU,   "Stopped (tty output)");
+      CASE_SIG_STR(SIGURG,    "Urgent I/O condition");
+      CASE_SIG_STR(SIGXCPU,   "CPU time limit exceeded");
+      CASE_SIG_STR(SIGXFSZ,   "File size limit exceeded");
+      CASE_SIG_STR(SIGVTALRM, "Virtual timer expired");
+      CASE_SIG_STR(SIGPROF,   "Profiling timer expired");
+      CASE_SIG_STR(SIGPOLL,   "Pollable event occurred");
+      CASE_SIG_STR(SIGSYS,    "Bad system call");
 
       /* Non-standard signals */
 
-#ifdef SIGWORK
-      case SIGWORK:
-        return (FAR char *)"SIGWORK";
-#endif
+#  ifdef SIGWORK

Review Comment:
   SIGWORK is used with `TSTATE_WAIT_PAGEFILL`, so I think evaluate if it is 
possible to replace it with SIGCONT in a separate PR. I do not want to take too 
much changes into one PR



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to