diff --git a/Documentation/reference/user/07_signals.rst b/Documentation/reference/user/07_signals.rst index 7fb8faf78f9..b7338138632 100644 --- a/Documentation/reference/user/07_signals.rst +++ b/Documentation/reference/user/07_signals.rst @@ -27,7 +27,7 @@ SIGUSR2 Abnormal Termination CONFIG_SIG_SIGUSR2_ACTION SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION SIGSTOP Suspend task CONFIG_SIG_SIGSTOP_ACTION -SIGSTP Suspend task CONFIG_SIG_SIGSTOP_ACTION +SIGTSTP Suspend task CONFIG_SIG_SIGSTOP_ACTION SIGCONT Resume task CONFIG_SIG_SIGSTOP_ACTION SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION diff --git a/TODO b/TODO index 8f6c551092f..60c231ad8d5 100644 --- a/TODO +++ b/TODO @@ -718,7 +718,7 @@ o Signals (sched/signal, arch/) SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION SIGSTOP Suspend task CONFIG_SIG_SIGSTOP_ACTION - SIGSTP Suspend task CONFIG_SIG_SIGSTOP_ACTION + SIGTSTP Suspend task CONFIG_SIG_SIGSTOP_ACTION SIGCONT Resume task CONFIG_SIG_SIGSTOP_ACTION SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION diff --git a/boards/arm/sama5/giant-board/configs/netnsh/defconfig b/boards/arm/sama5/giant-board/configs/netnsh/defconfig index e8e88f3d66f..d97f148565a 100644 --- a/boards/arm/sama5/giant-board/configs/netnsh/defconfig +++ b/boards/arm/sama5/giant-board/configs/netnsh/defconfig @@ -100,7 +100,7 @@ CONFIG_SYSLOG_TIMESTAMP=y CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_UBOOT_UIMAGE=y CONFIG_UIMAGE_ENTRY_POINT=0x20008040 diff --git a/boards/arm/sama5/giant-board/configs/sdmmc-net-nsh/defconfig b/boards/arm/sama5/giant-board/configs/sdmmc-net-nsh/defconfig index 7dfea4e5658..cc9fc3fccff 100644 --- a/boards/arm/sama5/giant-board/configs/sdmmc-net-nsh/defconfig +++ b/boards/arm/sama5/giant-board/configs/sdmmc-net-nsh/defconfig @@ -133,7 +133,7 @@ CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y CONFIG_SYSTEM_VI=y CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_UBOOT_UIMAGE=y CONFIG_UIMAGE_ENTRY_POINT=0x20008040 diff --git a/boards/arm/sama5/giant-board/configs/sdmmcnsh/defconfig b/boards/arm/sama5/giant-board/configs/sdmmcnsh/defconfig index 5e5a24e9545..3f8e0eccf5b 100644 --- a/boards/arm/sama5/giant-board/configs/sdmmcnsh/defconfig +++ b/boards/arm/sama5/giant-board/configs/sdmmcnsh/defconfig @@ -126,7 +126,7 @@ CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y CONFIG_SYSTEM_VI=y CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_USBDEV=y CONFIG_USBDEV_DMA=y diff --git a/boards/arm/sama5/sama5d2-xult/configs/netnsh/defconfig b/boards/arm/sama5/sama5d2-xult/configs/netnsh/defconfig index ee45ea1f82b..6d7020ee1fe 100644 --- a/boards/arm/sama5/sama5d2-xult/configs/netnsh/defconfig +++ b/boards/arm/sama5/sama5d2-xult/configs/netnsh/defconfig @@ -103,7 +103,7 @@ CONFIG_SYSLOG_TIMESTAMP=y CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_UBOOT_UIMAGE=y CONFIG_UIMAGE_ENTRY_POINT=0x20008040 diff --git a/boards/arm/sama5/sama5d2-xult/configs/sdmmcnsh/defconfig b/boards/arm/sama5/sama5d2-xult/configs/sdmmcnsh/defconfig index 3b94e264ccd..35ea6ab8228 100644 --- a/boards/arm/sama5/sama5d2-xult/configs/sdmmcnsh/defconfig +++ b/boards/arm/sama5/sama5d2-xult/configs/sdmmcnsh/defconfig @@ -130,7 +130,7 @@ CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y CONFIG_SYSTEM_VI=y CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_UART1_SERIAL_CONSOLE=y CONFIG_USBDEV=y CONFIG_USBDEV_DMA=y diff --git a/boards/arm/sama5/sama5d3-xplained/configs/ethernet-over-usb-2-high-speed/defconfig b/boards/arm/sama5/sama5d3-xplained/configs/ethernet-over-usb-2-high-speed/defconfig index 96c93515a81..8b65eb03890 100644 --- a/boards/arm/sama5/sama5d3-xplained/configs/ethernet-over-usb-2-high-speed/defconfig +++ b/boards/arm/sama5/sama5d3-xplained/configs/ethernet-over-usb-2-high-speed/defconfig @@ -116,7 +116,7 @@ CONFIG_SYSTEM_NSH=y CONFIG_SYSTEM_PING=y CONFIG_SYSTEM_VI=y CONFIG_TTY_SIGINT=y -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_USBDEV=y CONFIG_USBDEV_DMA=y CONFIG_USBDEV_DUALSPEED=y diff --git a/boards/sim/sim/sim/configs/tcpblaster/defconfig b/boards/sim/sim/sim/configs/tcpblaster/defconfig index 33b63ec6420..89910cabf45 100644 --- a/boards/sim/sim/sim/configs/tcpblaster/defconfig +++ b/boards/sim/sim/sim/configs/tcpblaster/defconfig @@ -125,6 +125,6 @@ CONFIG_TELNET_CHARACTER_MODE=y CONFIG_TELNET_TXBUFFER_SIZE=64 CONFIG_TTY_SIGINT=y CONFIG_TTY_SIGINT_CHAR=0x3 -CONFIG_TTY_SIGSTP=y +CONFIG_TTY_SIGTSTP=y CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_USER_ENTRYPOINT="nsh_main" diff --git a/drivers/net/telnet.c b/drivers/net/telnet.c index 00d31483409..fb7cea5b57a 100644 --- a/drivers/net/telnet.c +++ b/drivers/net/telnet.c @@ -68,7 +68,7 @@ #endif #undef HAVE_SIGNALS -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) # define HAVE_SIGNALS #endif @@ -289,18 +289,18 @@ static void telnet_check_ctrlchar(FAR struct telnet_dev_s *priv, } #endif -#ifdef CONFIG_TTY_SIGSTP - /* Is this the special character that will generate the SIGSTP +#ifdef CONFIG_TTY_SIGTSTP + /* Is this the special character that will generate the SIGTSTP * signal? */ - if (*buffer == CONFIG_TTY_SIGSTP_CHAR) + if (*buffer == CONFIG_TTY_SIGTSTP_CHAR) { /* Note that the kill is needed and do not put the character * into the Rx buffer. It should not be read as normal data. */ - signo = SIGSTP; + signo = SIGTSTP; #ifndef CONFIG_TTY_SIGINT break; #endif diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index de0061ac550..22e6b147b4f 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig @@ -192,14 +192,14 @@ config TTY_SIGINT INTR SIGINT Ctrl-C ETX(0x03) Interrupt KILL SIGKILL Ctrl-U NAK(0x15) Kill QUIT SIGQUIT Ctrl-\ FS (0x1c) Quit - SUSP SIGSTP Ctrl-Z SUB(0x1a) Suspend - DSUSP SIGSTP Ctrl-Y EM (0x19) Delayed suspend + SUSP SIGTSTP Ctrl-Z SUB(0x1a) Suspend + DSUSP SIGTSTP Ctrl-Y EM (0x19) Delayed suspend Additional requirements: - SIGKILL cannot be caught or ignored. Compared to SIGTERM which is like SIGKILL but can be caught or ignored. - SIGQUIT is like SIGINT but causes generation of a core dump - - SIGSTOP cannot be caught or ignored. SIGSTP is like SIGSTOP but + - SIGSTOP cannot be caught or ignored. SIGTSTP is like SIGSTOP but can be caught or ignored. - The delayed suspend (DSUSD) is like suspend (SUPD), except that the suspension is delayed until the next read operation @@ -219,8 +219,8 @@ config TTY_SIGINT_CHAR REVISIT: Traditionally Ctrl-C would generate SIGINT. Ctrl-D is the End-of-File character that should close the stream. -config TTY_SIGSTP - bool "Support SIGSTP" +config TTY_SIGTSTP + bool "Support SIGTSTP" default n select CONFIG_SIG_SIGSTOP_ACTION depends on SERIAL_TERMIOS @@ -237,24 +237,24 @@ config TTY_SIGSTP INTR SIGINT Ctrl-C ETX(0x03) Interrupt KILL SIGKILL Ctrl-U NAK(0x15) Kill QUIT SIGQUIT Ctrl-\ FS (0x1c) Quit - SUSP SIGSTP Ctrl-Z SUB(0x1a) Suspend - DSUSP SIGSTP Ctrl-Y EM (0x19) Delayed suspend + SUSP SIGTSTP Ctrl-Z SUB(0x1a) Suspend + DSUSP SIGTSTP Ctrl-Y EM (0x19) Delayed suspend Additional requirements: - SIGKILL cannot be caught or ignored. Compared to SIGTERM which is like SIGKILL but can be caught or ignored. - SIGQUIT is like SIGINT but causes generation of a core dump - - SIGSTOP cannot be caught or ignored. SIGSTP is like SIGSTOP but + - SIGSTOP cannot be caught or ignored. SIGTSTP is like SIGSTOP but can be caught or ignored. - The delayed suspend (DSUSD) is like suspend (SUPD), except that the suspension is delayed until the next read operation -config TTY_SIGSTP_CHAR - hex "Serial parse SIGSTP characters" +config TTY_SIGTSTP_CHAR + hex "Serial parse SIGTSTP characters" default 0x1a - depends on TTY_SIGSTP + depends on TTY_SIGTSTP ---help--- - Use ASCII 0x1a (Ctrl-z) input to determine whether to send a SIGSTP + Use ASCII 0x1a (Ctrl-z) input to determine whether to send a SIGTSTP event. Other characters may also be selected. # diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 80f7d4c41d3..61b0bd20df8 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -1372,7 +1372,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg) break; #endif -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) /* Make the controlling terminal of the calling process */ case TIOCSCTTY: @@ -1590,7 +1590,7 @@ errout: int uart_register(FAR const char *path, FAR uart_dev_t *dev) { #ifdef CONFIG_SERIAL_TERMIOS -# if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +# if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) /* Initialize of the task that will receive SIGINT signals. */ dev->pid = (pid_t)-1; diff --git a/drivers/serial/serial_dma.c b/drivers/serial/serial_dma.c index 5d9888ec448..f31dc4efdc5 100644 --- a/drivers/serial/serial_dma.c +++ b/drivers/serial/serial_dma.c @@ -55,7 +55,7 @@ * Name: uart_check_signo * * Description: - * Check if the SIGINT or SIGSTP character is in the contiguous Rx DMA + * Check if the SIGINT or SIGTSTP character is in the contiguous Rx DMA * buffer region. The first signal associated with the first such * character is returned. * @@ -64,12 +64,12 @@ * * Returned Value: * 0 if a signal-related character does not appear in the. Otherwise, - * SIGKILL or SIGSTP may be returned to indicate the appropriate signal + * SIGKILL or SIGTSTP may be returned to indicate the appropriate signal * action. * ****************************************************************************/ -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) static int uart_check_signo(const char *buf, size_t size) { size_t i; @@ -83,10 +83,10 @@ static int uart_check_signo(const char *buf, size_t size) } #endif -#ifdef CONFIG_TTY_SIGSTP - if (buf[i] == CONFIG_TTY_SIGSTP_CHAR) +#ifdef CONFIG_TTY_SIGTSTP + if (buf[i] == CONFIG_TTY_SIGTSTP_CHAR) { - return SIGSTP; + return SIGTSTP; } #endif } @@ -102,13 +102,13 @@ static int uart_check_signo(const char *buf, size_t size) * Check if the SIGINT character is anywhere in the newly received DMA * buffer. * - * REVISIT: We must also remove the SIGINT/SIGSTP character from the Rx + * REVISIT: We must also remove the SIGINT/SIGTSTP character from the Rx * buffer. It should not be read as normal data by the caller. * ****************************************************************************/ #if defined(CONFIG_SERIAL_RXDMA) && \ - (defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP)) + (defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)) static int uart_recvchars_signo(FAR uart_dev_t *dev) { FAR struct uart_dmaxfer_s *xfer = &dev->dmarx; @@ -370,7 +370,7 @@ void uart_recvchars_done(FAR uart_dev_t *dev) FAR struct uart_dmaxfer_s *xfer = &dev->dmarx; FAR struct uart_buffer_s *rxbuf = &dev->recv; size_t nbytes = xfer->nbytes; -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) int signo = 0; /* Check if the SIGINT character is anywhere in the newly received DMA @@ -398,7 +398,7 @@ void uart_recvchars_done(FAR uart_dev_t *dev) uart_datareceived(dev); } -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) /* Send the signal if necessary */ if (signo != 0) diff --git a/drivers/serial/serial_io.c b/drivers/serial/serial_io.c index e162de9475a..ddd4c3a99e4 100644 --- a/drivers/serial/serial_io.c +++ b/drivers/serial/serial_io.c @@ -139,7 +139,7 @@ void uart_recvchars(FAR uart_dev_t *dev) #endif unsigned int status; int nexthead = rxbuf->head + 1; -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) int signo = 0; #endif uint16_t nbytes = 0; @@ -233,13 +233,13 @@ void uart_recvchars(FAR uart_dev_t *dev) } else #endif -#ifdef CONFIG_TTY_SIGSTP - /* Is this the special character that will generate the SIGSTP +#ifdef CONFIG_TTY_SIGTSTP + /* Is this the special character that will generate the SIGTSTP * signal? */ if (dev->pid >= 0 && (dev->tc_lflag & ISIG) && - ch == CONFIG_TTY_SIGSTP_CHAR) + ch == CONFIG_TTY_SIGTSTP_CHAR) { #ifdef CONFIG_TTY_SIGINT /* Give precedence to SIGINT */ @@ -251,7 +251,7 @@ void uart_recvchars(FAR uart_dev_t *dev) * into the Rx buffer. It should not be read as normal data. */ - signo = SIGSTP; + signo = SIGTSTP; } } else @@ -292,7 +292,7 @@ void uart_recvchars(FAR uart_dev_t *dev) uart_datareceived(dev); } -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) /* Send the signal if necessary */ if (signo != 0) diff --git a/include/nuttx/serial/serial.h b/include/nuttx/serial/serial.h index 1dc39c44331..3a34d208626 100644 --- a/include/nuttx/serial/serial.h +++ b/include/nuttx/serial/serial.h @@ -300,7 +300,7 @@ struct uart_dev_s tcflag_t tc_iflag; /* Input modes */ tcflag_t tc_oflag; /* Output modes */ tcflag_t tc_lflag; /* Local modes */ -#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP) +#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP) pid_t pid; /* Thread PID to receive signals (-1 if none) */ #endif #endif diff --git a/include/signal.h b/include/signal.h index c247fde0336..6b48c38f74b 100644 --- a/include/signal.h +++ b/include/signal.h @@ -168,7 +168,7 @@ #ifdef CONFIG_SIG_SIGSTOP_ACTION # define SIGSTOP CONFIG_SIG_STOP -# define SIGSTP CONFIG_SIG_STP +# define SIGTSTP CONFIG_SIG_TSTP # define SIGCONT CONFIG_SIG_CONT #endif diff --git a/libs/libc/string/lib_strsignal.c b/libs/libc/string/lib_strsignal.c index 65438b49e8a..f68fbcddc70 100644 --- a/libs/libc/string/lib_strsignal.c +++ b/libs/libc/string/lib_strsignal.c @@ -143,9 +143,9 @@ FAR char *strsignal(int signum) return (FAR char *)"SIGSTOP"; #endif -#ifdef SIGSTP - case SIGSTP: - return (FAR char *)"SIGSTP"; +#ifdef SIGTSTP + case SIGTSTP: + return (FAR char *)"SIGTSTP"; #endif #ifdef SIGCONT diff --git a/sched/Kconfig b/sched/Kconfig index 86a1199acdb..baef337848c 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -1382,10 +1382,10 @@ config SIG_SIGPOLL_ACTION sigaction() to ignore SIGPOLL. config SIG_SIGSTOP_ACTION - bool "SIGSTOP SIGSTP, and SIGCONT" + bool "SIGSTOP SIGTSTP, and SIGCONT" default y ---help--- - Enable the default action for SIGSTOP and SIGSTP (suspend the + Enable the default action for SIGSTOP and SIGTSTP (suspend the task) and SIGCONT (resume the task). config SIG_SIGKILL_ACTION @@ -1452,8 +1452,8 @@ config SIG_STOP ---help--- Suspend/pause a task. SIGSTOP may not be caught or ignored. -config SIG_STP - int "SIGSTP" +config SIG_TSTP + int "SIGTSTP" default 7 depends on SIG_SIGSTOP_ACTION ---help--- diff --git a/sched/group/group_suspendchildren.c b/sched/group/group_suspendchildren.c index 5fb67a167cf..e7a1e9d41a5 100644 --- a/sched/group/group_suspendchildren.c +++ b/sched/group/group_suspendchildren.c @@ -86,7 +86,7 @@ static int group_suspend_children_handler(pid_t pid, FAR void *arg) * * Description: * Suspend all children of a task except for the specified task. This is - * SIGSTP/SIGSTOP default signal action logic. When the main task is + * SIGTSTP/SIGSTOP default signal action logic. When the main task is * suspended, all of its child pthreads must also be suspended. * * Input Parameters: diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index 927f8ff9548..73045efa282 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -194,7 +194,7 @@ volatile dq_queue_t g_waitingforfill; #ifdef CONFIG_SIG_SIGSTOP_ACTION /* This is the list of all tasks that have been stopped - * via SIGSTOP or SIGSTP + * via SIGSTOP or SIGTSTP */ volatile dq_queue_t g_stoppedtasks; diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c index 5dd018a0329..91a3dd6863f 100644 --- a/sched/signal/sig_default.c +++ b/sched/signal/sig_default.c @@ -134,7 +134,7 @@ static const struct nxsig_defaction_s g_defactions[] = #endif #ifdef CONFIG_SIG_SIGSTOP_ACTION { SIGSTOP, SIG_FLAG_NOCATCH, nxsig_stop_task }, - { SIGSTP, 0, nxsig_stop_task }, + { SIGTSTP, 0, nxsig_stop_task }, { SIGCONT, SIG_FLAG_NOCATCH, nxsig_null_action }, #endif #ifdef CONFIG_SIG_SIGKILL_ACTION diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 4821acbb2ae..e57bbefdd1b 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -451,7 +451,7 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) #endif #ifdef CONFIG_SIG_SIGSTOP_ACTION - /* If the task was stopped by SIGSTOP or SIGSTP, then unblock the task + /* If the task was stopped by SIGSTOP or SIGTSTP, then unblock the task * if SIGCONT is received. */