Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion canutils/candump/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/chrono/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/djoystick/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/i2sloop/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions examples/ipforward/ipforward.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -840,7 +848,12 @@ int main(int argc, FAR char *argv[])

/* 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)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/oneshot/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/shv-nxboot-updater/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
77 changes: 76 additions & 1 deletion examples/usrsocktest/usrsocktest_wake_with_signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions examples/xedge_demo/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/zerocross/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nshlib/nsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
26 changes: 14 additions & 12 deletions nshlib/nsh_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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>"),
Expand Down
Loading
Loading