This is an automated email from the ASF dual-hosted git repository.

jiuzhudong pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new d9afe2db8 signals: fix build and runtime issues when signals all 
isabled
d9afe2db8 is described below

commit d9afe2db8ce7f2bb1cef7c65fed56af307bb722f
Author: wangchengdong <[email protected]>
AuthorDate: Fri Jan 16 22:47:13 2026 +0800

    signals: fix build and runtime issues when signals all isabled
    
     Fix build and runtime issues when signals all disabled.
    
    Signed-off-by: Chengdong Wang <[email protected]>
---
 canutils/candump/Kconfig                           |  2 +-
 examples/chrono/Kconfig                            |  2 +-
 examples/djoystick/Kconfig                         |  2 +-
 examples/i2sloop/Kconfig                           |  2 +-
 examples/ipforward/ipforward.c                     | 13 ++++
 examples/oneshot/Kconfig                           |  2 +-
 examples/shv-nxboot-updater/Kconfig                |  2 +-
 .../usrsocktest/usrsocktest_wake_with_signal.c     | 77 +++++++++++++++++++++-
 examples/xedge_demo/Kconfig                        |  4 +-
 examples/zerocross/Kconfig                         |  2 +-
 nshlib/nsh.h                                       |  2 +
 nshlib/nsh_command.c                               | 26 ++++----
 nshlib/nsh_proccmds.c                              | 13 ++--
 system/sensortest/Kconfig                          |  2 +-
 testing/drivers/nand_sim/Kconfig                   |  2 +-
 testing/ostest/CMakeLists.txt                      | 22 ++++---
 testing/ostest/Makefile                            | 15 ++++-
 testing/ostest/ostest_main.c                       | 16 ++---
 wireless/ieee802154/i8sak/i8sak_events.c           | 14 ++++
 19 files changed, 172 insertions(+), 48 deletions(-)

diff --git a/canutils/candump/Kconfig b/canutils/candump/Kconfig
index 4359ec287..45a46118b 100644
--- a/canutils/candump/Kconfig
+++ b/canutils/candump/Kconfig
@@ -6,7 +6,7 @@
 config CANUTILS_CANDUMP
        tristate "SocketCAN candump tool"
        default n
-       depends on NET_CAN && CANUTILS_LIBCANUTILS
+       depends on NET_CAN && CANUTILS_LIBCANUTILS && ENABLE_ALL_SIGNALS
        ---help---
                Enable the SocketCAN candump tool ported from
                https://github.com/linux-can/can-utils
diff --git a/examples/chrono/Kconfig b/examples/chrono/Kconfig
index 866bc660a..324f0c452 100644
--- a/examples/chrono/Kconfig
+++ b/examples/chrono/Kconfig
@@ -6,7 +6,7 @@
 config EXAMPLES_CHRONO
        tristate "Chronometer example to use with STM32LDiscover"
        default n
-       depends on SLCD
+       depends on SLCD && ENABLE_ALL_SIGNALS
        ---help---
                Enable the Chronometer example
 
diff --git a/examples/djoystick/Kconfig b/examples/djoystick/Kconfig
index 7bfad3a2e..68e38ab6e 100644
--- a/examples/djoystick/Kconfig
+++ b/examples/djoystick/Kconfig
@@ -6,7 +6,7 @@
 config EXAMPLES_DJOYSTICK
        tristate "Discrete joystick example"
        default n
-       depends on INPUT_DJOYSTICK
+       depends on INPUT_DJOYSTICK && ENABLE_ALL_SIGNALS
        ---help---
                Enable the discrete joystick example
 
diff --git a/examples/i2sloop/Kconfig b/examples/i2sloop/Kconfig
index cea8333cd..982c0b020 100644
--- a/examples/i2sloop/Kconfig
+++ b/examples/i2sloop/Kconfig
@@ -6,6 +6,6 @@
 config EXAMPLES_I2SLOOP
        tristate "I2S loopback test"
        default n
-       depends on I2S && AUDIO && DRIVERS_AUDIO && AUDIO_I2SCHAR
+       depends on I2S && AUDIO && DRIVERS_AUDIO && AUDIO_I2SCHAR && 
ENABLE_ALL_SIGNALS
        ---help---
                Enable the I2S loopback test
diff --git a/examples/ipforward/ipforward.c b/examples/ipforward/ipforward.c
index 57b146e7e..ae9ee5831 100644
--- a/examples/ipforward/ipforward.c
+++ b/examples/ipforward/ipforward.c
@@ -542,8 +542,16 @@ static FAR void *ipfwd_receiver(FAR void *arg)
   int errcode;
   int i;
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   for (i = 0; i < IPFWD_NPACKETS; i++)
     {
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+      pthread_testcancel();
+#endif
       nread = read(fwd->ia_fd, fwd->ia_buffer, IPFWD_BUFSIZE);
       if (nread < 0)
         {
@@ -840,7 +848,12 @@ errout_with_receiver:
 
   /* Wait for receiver thread to terminate */
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_cancel(fwd.if_receiver);
+#else
   pthread_kill(fwd.if_receiver, 9);
+#endif
+
   ret = pthread_join(fwd.if_receiver, &value);
   if (ret != OK)
     {
diff --git a/examples/oneshot/Kconfig b/examples/oneshot/Kconfig
index 43cc117e1..3b9505985 100644
--- a/examples/oneshot/Kconfig
+++ b/examples/oneshot/Kconfig
@@ -6,7 +6,7 @@
 config EXAMPLES_ONESHOT
        tristate "Oneshot timer example"
        default n
-       depends on ONESHOT
+       depends on ONESHOT && ENABLE_ALL_SIGNALS
        ---help---
                Enable the oneshot timer driver example
 
diff --git a/examples/shv-nxboot-updater/Kconfig 
b/examples/shv-nxboot-updater/Kconfig
index d25da7cd0..80ace34ba 100644
--- a/examples/shv-nxboot-updater/Kconfig
+++ b/examples/shv-nxboot-updater/Kconfig
@@ -5,7 +5,7 @@
 
 menuconfig EXAMPLES_SHV_NXBOOT_UPDATER
        bool "Silicon Heaven Firmware updates for NXBoot"
-       depends on NETUTILS_LIBSHVC
+       depends on NETUTILS_LIBSHVC && ENABLE_ALL_SIGNALS
        default n
        ---help---
                Enable the shv-nxboot-updater application.
diff --git a/examples/usrsocktest/usrsocktest_wake_with_signal.c 
b/examples/usrsocktest/usrsocktest_wake_with_signal.c
index 800eb571d..da460ab15 100644
--- a/examples/usrsocktest/usrsocktest_wake_with_signal.c
+++ b/examples/usrsocktest/usrsocktest_wake_with_signal.c
@@ -146,11 +146,20 @@ static void do_usrsock_blocking_socket_thread(FAR void 
*param)
   TEST_ASSERT_TRUE(test_hang);
   TEST_ASSERT_TRUE(test_abort);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Allow main thread to hang usrsock daemon at this point. */
 
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt hanging open socket. */
 
   sem_post(&tid_startsem);
@@ -176,6 +185,11 @@ static void do_usrsock_blocking_close_thread(FAR void 
*param)
   TEST_ASSERT_TRUE(test_hang);
   TEST_ASSERT_TRUE(test_abort);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -190,6 +204,10 @@ static void do_usrsock_blocking_close_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt hanging close socket. */
 
   sem_post(&tid_startsem);
@@ -214,6 +232,11 @@ static void do_usrsock_blocking_connect_thread(FAR void 
*param)
 
   TEST_ASSERT_TRUE(test_hang || !test_hang);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -228,6 +251,10 @@ static void do_usrsock_blocking_connect_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt blocking connect. */
 
   sem_post(&tid_startsem);
@@ -257,6 +284,11 @@ static void do_usrsock_blocking_setsockopt_thread(FAR void 
*param)
   bool test_abort = !!(test_flags & TEST_FLAG_DAEMON_ABORT);
   bool test_hang = !!(test_flags & TEST_FLAG_PAUSE_USRSOCK_HANDLING);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -274,6 +306,10 @@ static void do_usrsock_blocking_setsockopt_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt hanging setsockopt. */
 
   sem_post(&tid_startsem);
@@ -304,6 +340,11 @@ static void do_usrsock_blocking_getsockopt_thread(FAR void 
*param)
   bool test_abort = !!(test_flags & TEST_FLAG_DAEMON_ABORT);
   bool test_hang = !!(test_flags & TEST_FLAG_PAUSE_USRSOCK_HANDLING);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -321,6 +362,10 @@ static void do_usrsock_blocking_getsockopt_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt hanging getsockopt. */
 
   sem_post(&tid_startsem);
@@ -352,6 +397,11 @@ static void do_usrsock_blocking_send_thread(FAR void 
*param)
 
   TEST_ASSERT_TRUE(test_hang || !test_hang);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -372,6 +422,10 @@ static void do_usrsock_blocking_send_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt blocking send. */
 
   sem_post(&tid_startsem);
@@ -401,6 +455,11 @@ static void do_usrsock_blocking_recv_thread(FAR void 
*param)
 
   TEST_ASSERT_TRUE(test_hang || !test_hang);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -421,6 +480,10 @@ static void do_usrsock_blocking_recv_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt blocking recv. */
 
   sem_post(&tid_startsem);
@@ -454,6 +517,11 @@ static void do_usrsock_blocking_poll_thread(FAR void 
*param)
   TEST_ASSERT_TRUE(test_abort);
   TEST_ASSERT_TRUE(test_hang || !test_hang);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   /* Open socket. */
 
   test_sd[tidx] = socket(AF_INET, SOCK_STREAM, 0);
@@ -474,6 +542,10 @@ static void do_usrsock_blocking_poll_thread(FAR void 
*param)
   sem_post(&tid_startsem);
   sem_wait(&tid_releasesem);
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_testcancel();
+#endif
+
   /* Attempt poll. */
 
   pfd.fd = test_sd[tidx];
@@ -560,8 +632,11 @@ static void do_wake_test(enum e_test_type type, int flags)
 
       for (tidx = 0; tidx < nthreads; tidx++)
         {
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+          pthread_cancel(tid[tidx]);
+#else
           pthread_kill(tid[tidx], SIGUSR1);
-
+#endif
           /* Wait threads to complete work. */
 
           ret = pthread_join(tid[tidx], NULL);
diff --git a/examples/xedge_demo/Kconfig b/examples/xedge_demo/Kconfig
index 9bc02d0fa..183f18b28 100644
--- a/examples/xedge_demo/Kconfig
+++ b/examples/xedge_demo/Kconfig
@@ -5,11 +5,11 @@
 
 config EXAMPLES_XEDGE_DEMO
        tristate "Xedge IoT Toolkit Demo"
-       depends on NETUTILS_XEDGE && ALLOW_GPL_COMPONENTS
+       depends on NETUTILS_XEDGE && ALLOW_GPL_COMPONENTS && ENABLE_ALL_SIGNALS
        default n
        ---help---
                Simple demonstration of the Xedge IoT Toolkit library.
-               
+
                This example shows how to integrate and use the Xedge library
                in your NuttX application. Xedge provides a high-level 
development
                environment for creating IoT and industrial device applications
diff --git a/examples/zerocross/Kconfig b/examples/zerocross/Kconfig
index b49614731..758c4781a 100644
--- a/examples/zerocross/Kconfig
+++ b/examples/zerocross/Kconfig
@@ -6,7 +6,7 @@
 config EXAMPLES_ZEROCROSS
        tristate "Zero Cross Detection example"
        default n
-       depends on SENSORS_ZEROCROSS
+       depends on SENSORS_ZEROCROSS && ENABLE_ALL_SIGNALS
        ---help---
                Enable the zero cross detection example
 
diff --git a/nshlib/nsh.h b/nshlib/nsh.h
index 9c2c1d5ed..74f4032cc 100644
--- a/nshlib/nsh.h
+++ b/nshlib/nsh.h
@@ -1179,6 +1179,7 @@ int cmd_switchboot(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char **argv);
   int cmd_unset(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
 #endif
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
 #ifndef CONFIG_NSH_DISABLE_KILL
   int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
 #endif
@@ -1191,6 +1192,7 @@ int cmd_switchboot(FAR struct nsh_vtbl_s *vtbl, int argc, 
FAR char **argv);
 #ifndef CONFIG_NSH_DISABLE_USLEEP
   int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
 #endif
+#endif /* !CONFIG_DISABLE_ALL_SIGNALS */
 
 #ifndef CONFIG_NSH_DISABLE_UPTIME
   int cmd_uptime(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv);
diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c
index 03a14ace9..af0084218 100644
--- a/nshlib/nsh_command.c
+++ b/nshlib/nsh_command.c
@@ -304,14 +304,6 @@ static const struct cmdmap_s g_cmdmap[] =
   CMD_MAP("irqinfo",  cmd_irqinfo,  1, 1, NULL),
 #endif
 
-#ifndef CONFIG_NSH_DISABLE_KILL
-  CMD_MAP("kill",     cmd_kill,     2, 3, "[-<signal>] <pid>"),
-#endif
-
-#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL)
-  CMD_MAP("pkill",     cmd_pkill,     2, 3, "[-<signal>] <name>"),
-#endif
-
 #ifndef CONFIG_DISABLE_MOUNTPOINT
 #  if defined(CONFIG_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSETUP)
   CMD_MAP("losetup",  cmd_losetup,  3, 6,
@@ -575,10 +567,24 @@ static const struct cmdmap_s g_cmdmap[] =
 #endif
 #endif
 
+#ifndef CONFIG_DISABLE_ALL_SIGNALS
+#ifndef CONFIG_NSH_DISABLE_KILL
+  CMD_MAP("kill",     cmd_kill,     2, 3, "[-<signal>] <pid>"),
+#endif
+
+#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL)
+  CMD_MAP("pkill",     cmd_pkill,     2, 3, "[-<signal>] <name>"),
+#endif
+
 #ifndef CONFIG_NSH_DISABLE_SLEEP
   CMD_MAP("sleep",    cmd_sleep,    2, 2, "<sec>"),
 #endif
 
+#ifndef CONFIG_NSH_DISABLE_USLEEP
+  CMD_MAP("usleep",   cmd_usleep,   2, 2, "<usec>"),
+#endif
+#endif
+
 #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_SOURCE)
   CMD_MAP("source",   cmd_source,   2, 2, "<script-path>"),
 #endif
@@ -657,10 +663,6 @@ static const struct cmdmap_s g_cmdmap[] =
 #  endif
 #endif
 
-#ifndef CONFIG_NSH_DISABLE_USLEEP
-  CMD_MAP("usleep",   cmd_usleep,   2, 2, "<usec>"),
-#endif
-
 #ifndef CONFIG_NSH_DISABLE_WATCH
   CMD_MAP("watch",     cmd_watch,
           2, 6, "[-n] interval [-c] count <command>"),
diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c
index c7eff26eb..02a9869aa 100644
--- a/nshlib/nsh_proccmds.c
+++ b/nshlib/nsh_proccmds.c
@@ -995,7 +995,8 @@ int cmd_pidof(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
  * Name: cmd_kill
  ****************************************************************************/
 
-#ifndef CONFIG_NSH_DISABLE_KILL
+#if !defined(CONFIG_NSH_DISABLE_KILL) && \
+    !defined(CONFIG_DISABLE_ALL_SIGNALS)
 int cmd_kill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
 {
   FAR char *ptr;
@@ -1098,7 +1099,8 @@ invalid_arg:
  * Name: cmd_pkill
  ****************************************************************************/
 
-#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL)
+#if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_NSH_DISABLE_PKILL) && \
+    !defined(CONFIG_DISABLE_ALL_SIGNALS)
 int cmd_pkill(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
 {
   FAR const char *name;
@@ -1199,7 +1201,8 @@ invalid_arg:
  * Name: cmd_sleep
  ****************************************************************************/
 
-#ifndef CONFIG_NSH_DISABLE_SLEEP
+#if !defined(CONFIG_NSH_DISABLE_SLEEP) && \
+    !defined(CONFIG_DISABLE_ALL_SIGNALS)
 int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
 {
   UNUSED(argc);
@@ -1222,8 +1225,8 @@ int cmd_sleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR 
char **argv)
 /****************************************************************************
  * Name: cmd_usleep
  ****************************************************************************/
-
-#ifndef CONFIG_NSH_DISABLE_USLEEP
+#if !defined(CONFIG_NSH_DISABLE_USLEEP) && \
+    !defined(CONFIG_DISABLE_ALL_SIGNALS)
 int cmd_usleep(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
 {
   UNUSED(argc);
diff --git a/system/sensortest/Kconfig b/system/sensortest/Kconfig
index 8f54695ed..68f1f951d 100644
--- a/system/sensortest/Kconfig
+++ b/system/sensortest/Kconfig
@@ -6,7 +6,7 @@
 config SYSTEM_SENSORTEST
        tristate "Sensor driver test"
        default n
-       depends on SENSORS
+       depends on SENSORS && ENABLE_ALL_SIGNALS
        ---help---
                Enable the Sensor driver test
 
diff --git a/testing/drivers/nand_sim/Kconfig b/testing/drivers/nand_sim/Kconfig
index ccf2c657b..e76cdc3f5 100644
--- a/testing/drivers/nand_sim/Kconfig
+++ b/testing/drivers/nand_sim/Kconfig
@@ -5,7 +5,7 @@
 
 config TESTING_NAND_SIM
        boolean "NAND Flash Simulator"
-       depends on MTD_NAND_RAM
+       depends on MTD_NAND_RAM && ENABLE_ALL_SIGNALS
        default n
        ---help---
                Enable the NAND Flash Simulator device.
diff --git a/testing/ostest/CMakeLists.txt b/testing/ostest/CMakeLists.txt
index 6e971373d..777c68744 100644
--- a/testing/ostest/CMakeLists.txt
+++ b/testing/ostest/CMakeLists.txt
@@ -22,14 +22,15 @@
 
 if(CONFIG_TESTING_OSTEST)
 
-  set(SRCS
-      getopt.c
-      libc_memmem.c
-      restart.c
-      sigprocmask.c
-      sighand.c
-      signest.c
-      sighelper.c)
+  set(SRCS getopt.c libc_memmem.c restart.c sighelper.c)
+
+  if(CONFIG_ENABLE_ALL_SIGNALS)
+    list(APPEND SRCS sighand.c signest.c)
+  endif()
+
+  if(NOT CONFIG_DISABLE_ALL_SIGNALS)
+    list(APPEND SRCS sigprocmask.c)
+  endif()
 
   if(CONFIG_DEV_NULL)
     list(APPEND SRCS dev_null.c)
@@ -124,7 +125,10 @@ if(CONFIG_TESTING_OSTEST)
 
   if(NOT CONFIG_DISABLE_MQUEUE)
     if(NOT CONFIG_DISABLE_PTHREAD)
-      list(APPEND SRCS mqueue.c timedmqueue.c)
+      list(APPEND SRCS timedmqueue.c)
+      if(NOT CONFIG_DISABLE_ALL_SIGNALS)
+        list(APPEND SRCS mqueue.c)
+      endif()
     endif() # CONFIG_DISABLE_PTHREAD
   endif() # CONFIG_DISABLE_MQUEUE
 
diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile
index 5f7d5d4f8..128a31798 100644
--- a/testing/ostest/Makefile
+++ b/testing/ostest/Makefile
@@ -31,9 +31,17 @@ MODULE = $(CONFIG_TESTING_OSTEST)
 
 # NuttX OS Test
 
-CSRCS   = getopt.c libc_memmem.c restart.c sigprocmask.c sighand.c \
+CSRCS   = getopt.c libc_memmem.c restart.c \
           signest.c sighelper.c
 
+ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y)
+CSRCS += sighand.c signest.c
+endif
+
+ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
+CSRCS += sigprocmask.c
+endif
+
 MAINSRC = ostest_main.c
 
 ifeq ($(CONFIG_DEV_NULL),y)
@@ -119,7 +127,10 @@ endif # CONFIG_DISABLE_PTHREAD
 
 ifneq ($(CONFIG_DISABLE_MQUEUE),y)
 ifneq ($(CONFIG_DISABLE_PTHREAD),y)
-CSRCS += mqueue.c timedmqueue.c
+CSRCS += timedmqueue.c
+ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
+CSRCS += mqueue.c
+endif
 endif # CONFIG_DISABLE_PTHREAD
 endif # CONFIG_DISABLE_MQUEUE
 
diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c
index 975a10410..6bf75d86f 100644
--- a/testing/ostest/ostest_main.c
+++ b/testing/ostest/ostest_main.c
@@ -496,14 +496,6 @@ static int user_main(int argc, char *argv[])
       check_test_memory_usage();
 #endif /* !CONFIG_DISABLE_PTHREAD */
 
-#if !defined(CONFIG_DISABLE_MQUEUE) && !defined(CONFIG_DISABLE_PTHREAD)
-      /* Verify pthreads and message queues */
-
-      printf("\nuser_main: message queue test\n");
-      mqueue_test();
-      check_test_memory_usage();
-#endif
-
 #if !defined(CONFIG_DISABLE_MQUEUE) && !defined(CONFIG_DISABLE_PTHREAD)
       /* Verify pthreads and message queues */
 
@@ -519,6 +511,14 @@ static int user_main(int argc, char *argv[])
       sigprocmask_test();
       check_test_memory_usage();
 
+#if !defined(CONFIG_DISABLE_MQUEUE) && !defined(CONFIG_DISABLE_PTHREAD)
+      /* Verify pthreads and message queues */
+
+      printf("\nuser_main: message queue test\n");
+      mqueue_test();
+      check_test_memory_usage();
+#endif
+
 #if defined(CONFIG_SIG_SIGSTOP_ACTION) && defined(CONFIG_SIG_SIGKILL_ACTION) 
&& \
     !defined(CONFIG_BUILD_KERNEL)
       printf("\nuser_main: signal action test\n");
diff --git a/wireless/ieee802154/i8sak/i8sak_events.c 
b/wireless/ieee802154/i8sak/i8sak_events.c
index 12e4758b9..143e7ae3e 100644
--- a/wireless/ieee802154/i8sak/i8sak_events.c
+++ b/wireless/ieee802154/i8sak/i8sak_events.c
@@ -68,6 +68,11 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg)
   FAR struct ieee802154_primitive_s *primitive = NULL;
   int ret = OK;
 
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+  pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);
+#endif
+
   if (i8sak->mode == I8SAK_MODE_CHAR)
     {
       macarg.enable = true;
@@ -86,6 +91,9 @@ static pthread_addr_t i8sak_eventthread(pthread_addr_t arg)
 
   while (i8sak->eventlistener_run)
     {
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+      pthread_testcancel();
+#endif
       if (i8sak->mode == I8SAK_MODE_CHAR)
         {
           ret = ioctl(i8sak->fd, MAC802154IOC_GET_EVENT,
@@ -256,7 +264,13 @@ int i8sak_eventlistener_stop(FAR struct i8sak_s *i8sak)
   FAR void *value;
 
   i8sak->eventlistener_run = false;
+
+#ifdef CONFIG_DISABLE_ALL_SIGNALS
+  pthread_cancel(i8sak->eventlistener_threadid);
+#else
   pthread_kill(i8sak->eventlistener_threadid, 2);
+#endif
+
   ret = pthread_join(i8sak->eventlistener_threadid, &value);
   if (ret != OK)
     {

Reply via email to