mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
Modify SIGSTP to SIGTSTP
Follow the POSIX description. SIGTSTP should be sent when the Ctrl-Z characters is encountered, not SIGSTP. Testing: Built with hifive1-revb:nsh (CONFIG_SERIAL_TERMIOS=y, CONFIG_SIG_DEFAULT=y and CONFIG_TTY_SIGTSTP=y)
This commit is contained in:
committed by
Xiang Xiao
parent
96d1f018c4
commit
c13f869432
@@ -27,7 +27,7 @@ SIGUSR2 Abnormal Termination CONFIG_SIG_SIGUSR2_ACTION
|
|||||||
SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION
|
SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION
|
||||||
SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION
|
SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION
|
||||||
SIGSTOP Suspend task CONFIG_SIG_SIGSTOP_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
|
SIGCONT Resume task CONFIG_SIG_SIGSTOP_ACTION
|
||||||
SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
||||||
SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
||||||
|
|||||||
@@ -718,7 +718,7 @@ o Signals (sched/signal, arch/)
|
|||||||
SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION
|
SIGALRM Abnormal Termination CONFIG_SIG_SIGALRM_ACTION
|
||||||
SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION
|
SIGPOLL Abnormal Termination CONFIG_SIG_SIGPOLL_ACTION
|
||||||
SIGSTOP Suspend task CONFIG_SIG_SIGSTOP_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
|
SIGCONT Resume task CONFIG_SIG_SIGSTOP_ACTION
|
||||||
SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
SIGINT Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
||||||
SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
SIGKILL Abnormal Termination CONFIG_SIG_SIGKILL_ACTION
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ CONFIG_SYSLOG_TIMESTAMP=y
|
|||||||
CONFIG_SYSTEM_NSH=y
|
CONFIG_SYSTEM_NSH=y
|
||||||
CONFIG_SYSTEM_PING=y
|
CONFIG_SYSTEM_PING=y
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||||
CONFIG_UBOOT_UIMAGE=y
|
CONFIG_UBOOT_UIMAGE=y
|
||||||
CONFIG_UIMAGE_ENTRY_POINT=0x20008040
|
CONFIG_UIMAGE_ENTRY_POINT=0x20008040
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ CONFIG_SYSTEM_NSH=y
|
|||||||
CONFIG_SYSTEM_PING=y
|
CONFIG_SYSTEM_PING=y
|
||||||
CONFIG_SYSTEM_VI=y
|
CONFIG_SYSTEM_VI=y
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||||
CONFIG_UBOOT_UIMAGE=y
|
CONFIG_UBOOT_UIMAGE=y
|
||||||
CONFIG_UIMAGE_ENTRY_POINT=0x20008040
|
CONFIG_UIMAGE_ENTRY_POINT=0x20008040
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ CONFIG_SYSTEM_NSH=y
|
|||||||
CONFIG_SYSTEM_PING=y
|
CONFIG_SYSTEM_PING=y
|
||||||
CONFIG_SYSTEM_VI=y
|
CONFIG_SYSTEM_VI=y
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||||
CONFIG_USBDEV=y
|
CONFIG_USBDEV=y
|
||||||
CONFIG_USBDEV_DMA=y
|
CONFIG_USBDEV_DMA=y
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ CONFIG_SYSLOG_TIMESTAMP=y
|
|||||||
CONFIG_SYSTEM_NSH=y
|
CONFIG_SYSTEM_NSH=y
|
||||||
CONFIG_SYSTEM_PING=y
|
CONFIG_SYSTEM_PING=y
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||||
CONFIG_UBOOT_UIMAGE=y
|
CONFIG_UBOOT_UIMAGE=y
|
||||||
CONFIG_UIMAGE_ENTRY_POINT=0x20008040
|
CONFIG_UIMAGE_ENTRY_POINT=0x20008040
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ CONFIG_SYSTEM_NSH=y
|
|||||||
CONFIG_SYSTEM_PING=y
|
CONFIG_SYSTEM_PING=y
|
||||||
CONFIG_SYSTEM_VI=y
|
CONFIG_SYSTEM_VI=y
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_UART1_SERIAL_CONSOLE=y
|
CONFIG_UART1_SERIAL_CONSOLE=y
|
||||||
CONFIG_USBDEV=y
|
CONFIG_USBDEV=y
|
||||||
CONFIG_USBDEV_DMA=y
|
CONFIG_USBDEV_DMA=y
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ CONFIG_SYSTEM_NSH=y
|
|||||||
CONFIG_SYSTEM_PING=y
|
CONFIG_SYSTEM_PING=y
|
||||||
CONFIG_SYSTEM_VI=y
|
CONFIG_SYSTEM_VI=y
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_USBDEV=y
|
CONFIG_USBDEV=y
|
||||||
CONFIG_USBDEV_DMA=y
|
CONFIG_USBDEV_DMA=y
|
||||||
CONFIG_USBDEV_DUALSPEED=y
|
CONFIG_USBDEV_DUALSPEED=y
|
||||||
|
|||||||
@@ -125,6 +125,6 @@ CONFIG_TELNET_CHARACTER_MODE=y
|
|||||||
CONFIG_TELNET_TXBUFFER_SIZE=64
|
CONFIG_TELNET_TXBUFFER_SIZE=64
|
||||||
CONFIG_TTY_SIGINT=y
|
CONFIG_TTY_SIGINT=y
|
||||||
CONFIG_TTY_SIGINT_CHAR=0x3
|
CONFIG_TTY_SIGINT_CHAR=0x3
|
||||||
CONFIG_TTY_SIGSTP=y
|
CONFIG_TTY_SIGTSTP=y
|
||||||
CONFIG_USERMAIN_STACKSIZE=4096
|
CONFIG_USERMAIN_STACKSIZE=4096
|
||||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef HAVE_SIGNALS
|
#undef HAVE_SIGNALS
|
||||||
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP)
|
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGTSTP)
|
||||||
# define HAVE_SIGNALS
|
# define HAVE_SIGNALS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -289,18 +289,18 @@ static void telnet_check_ctrlchar(FAR struct telnet_dev_s *priv,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TTY_SIGSTP
|
#ifdef CONFIG_TTY_SIGTSTP
|
||||||
/* Is this the special character that will generate the SIGSTP
|
/* Is this the special character that will generate the SIGTSTP
|
||||||
* signal?
|
* 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
|
/* Note that the kill is needed and do not put the character
|
||||||
* into the Rx buffer. It should not be read as normal data.
|
* into the Rx buffer. It should not be read as normal data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
signo = SIGSTP;
|
signo = SIGTSTP;
|
||||||
#ifndef CONFIG_TTY_SIGINT
|
#ifndef CONFIG_TTY_SIGINT
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+12
-12
@@ -192,14 +192,14 @@ config TTY_SIGINT
|
|||||||
INTR SIGINT Ctrl-C ETX(0x03) Interrupt
|
INTR SIGINT Ctrl-C ETX(0x03) Interrupt
|
||||||
KILL SIGKILL Ctrl-U NAK(0x15) Kill
|
KILL SIGKILL Ctrl-U NAK(0x15) Kill
|
||||||
QUIT SIGQUIT Ctrl-\ FS (0x1c) Quit
|
QUIT SIGQUIT Ctrl-\ FS (0x1c) Quit
|
||||||
SUSP SIGSTP Ctrl-Z SUB(0x1a) Suspend
|
SUSP SIGTSTP Ctrl-Z SUB(0x1a) Suspend
|
||||||
DSUSP SIGSTP Ctrl-Y EM (0x19) Delayed suspend
|
DSUSP SIGTSTP Ctrl-Y EM (0x19) Delayed suspend
|
||||||
|
|
||||||
Additional requirements:
|
Additional requirements:
|
||||||
- SIGKILL cannot be caught or ignored. Compared to SIGTERM which
|
- SIGKILL cannot be caught or ignored. Compared to SIGTERM which
|
||||||
is like SIGKILL but can be caught or ignored.
|
is like SIGKILL but can be caught or ignored.
|
||||||
- SIGQUIT is like SIGINT but causes generation of a core dump
|
- 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.
|
can be caught or ignored.
|
||||||
- The delayed suspend (DSUSD) is like suspend (SUPD), except that
|
- The delayed suspend (DSUSD) is like suspend (SUPD), except that
|
||||||
the suspension is delayed until the next read operation
|
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
|
REVISIT: Traditionally Ctrl-C would generate SIGINT. Ctrl-D is the
|
||||||
End-of-File character that should close the stream.
|
End-of-File character that should close the stream.
|
||||||
|
|
||||||
config TTY_SIGSTP
|
config TTY_SIGTSTP
|
||||||
bool "Support SIGSTP"
|
bool "Support SIGTSTP"
|
||||||
default n
|
default n
|
||||||
select CONFIG_SIG_SIGSTOP_ACTION
|
select CONFIG_SIG_SIGSTOP_ACTION
|
||||||
depends on SERIAL_TERMIOS
|
depends on SERIAL_TERMIOS
|
||||||
@@ -237,24 +237,24 @@ config TTY_SIGSTP
|
|||||||
INTR SIGINT Ctrl-C ETX(0x03) Interrupt
|
INTR SIGINT Ctrl-C ETX(0x03) Interrupt
|
||||||
KILL SIGKILL Ctrl-U NAK(0x15) Kill
|
KILL SIGKILL Ctrl-U NAK(0x15) Kill
|
||||||
QUIT SIGQUIT Ctrl-\ FS (0x1c) Quit
|
QUIT SIGQUIT Ctrl-\ FS (0x1c) Quit
|
||||||
SUSP SIGSTP Ctrl-Z SUB(0x1a) Suspend
|
SUSP SIGTSTP Ctrl-Z SUB(0x1a) Suspend
|
||||||
DSUSP SIGSTP Ctrl-Y EM (0x19) Delayed suspend
|
DSUSP SIGTSTP Ctrl-Y EM (0x19) Delayed suspend
|
||||||
|
|
||||||
Additional requirements:
|
Additional requirements:
|
||||||
- SIGKILL cannot be caught or ignored. Compared to SIGTERM which
|
- SIGKILL cannot be caught or ignored. Compared to SIGTERM which
|
||||||
is like SIGKILL but can be caught or ignored.
|
is like SIGKILL but can be caught or ignored.
|
||||||
- SIGQUIT is like SIGINT but causes generation of a core dump
|
- 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.
|
can be caught or ignored.
|
||||||
- The delayed suspend (DSUSD) is like suspend (SUPD), except that
|
- The delayed suspend (DSUSD) is like suspend (SUPD), except that
|
||||||
the suspension is delayed until the next read operation
|
the suspension is delayed until the next read operation
|
||||||
|
|
||||||
config TTY_SIGSTP_CHAR
|
config TTY_SIGTSTP_CHAR
|
||||||
hex "Serial parse SIGSTP characters"
|
hex "Serial parse SIGTSTP characters"
|
||||||
default 0x1a
|
default 0x1a
|
||||||
depends on TTY_SIGSTP
|
depends on TTY_SIGTSTP
|
||||||
---help---
|
---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.
|
event. Other characters may also be selected.
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1372,7 +1372,7 @@ static int uart_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#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 */
|
/* Make the controlling terminal of the calling process */
|
||||||
|
|
||||||
case TIOCSCTTY:
|
case TIOCSCTTY:
|
||||||
@@ -1590,7 +1590,7 @@ errout:
|
|||||||
int uart_register(FAR const char *path, FAR uart_dev_t *dev)
|
int uart_register(FAR const char *path, FAR uart_dev_t *dev)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_SERIAL_TERMIOS
|
#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. */
|
/* Initialize of the task that will receive SIGINT signals. */
|
||||||
|
|
||||||
dev->pid = (pid_t)-1;
|
dev->pid = (pid_t)-1;
|
||||||
|
|||||||
+10
-10
@@ -55,7 +55,7 @@
|
|||||||
* Name: uart_check_signo
|
* Name: uart_check_signo
|
||||||
*
|
*
|
||||||
* Description:
|
* 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
|
* buffer region. The first signal associated with the first such
|
||||||
* character is returned.
|
* character is returned.
|
||||||
*
|
*
|
||||||
@@ -64,12 +64,12 @@
|
|||||||
*
|
*
|
||||||
* Returned Value:
|
* Returned Value:
|
||||||
* 0 if a signal-related character does not appear in the. Otherwise,
|
* 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.
|
* 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)
|
static int uart_check_signo(const char *buf, size_t size)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
@@ -83,10 +83,10 @@ static int uart_check_signo(const char *buf, size_t size)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_TTY_SIGSTP
|
#ifdef CONFIG_TTY_SIGTSTP
|
||||||
if (buf[i] == CONFIG_TTY_SIGSTP_CHAR)
|
if (buf[i] == CONFIG_TTY_SIGTSTP_CHAR)
|
||||||
{
|
{
|
||||||
return SIGSTP;
|
return SIGTSTP;
|
||||||
}
|
}
|
||||||
#endif
|
#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
|
* Check if the SIGINT character is anywhere in the newly received DMA
|
||||||
* buffer.
|
* 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.
|
* buffer. It should not be read as normal data by the caller.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_SERIAL_RXDMA) && \
|
#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)
|
static int uart_recvchars_signo(FAR uart_dev_t *dev)
|
||||||
{
|
{
|
||||||
FAR struct uart_dmaxfer_s *xfer = &dev->dmarx;
|
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_dmaxfer_s *xfer = &dev->dmarx;
|
||||||
FAR struct uart_buffer_s *rxbuf = &dev->recv;
|
FAR struct uart_buffer_s *rxbuf = &dev->recv;
|
||||||
size_t nbytes = xfer->nbytes;
|
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;
|
int signo = 0;
|
||||||
|
|
||||||
/* Check if the SIGINT character is anywhere in the newly received DMA
|
/* 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);
|
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 */
|
/* Send the signal if necessary */
|
||||||
|
|
||||||
if (signo != 0)
|
if (signo != 0)
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void uart_recvchars(FAR uart_dev_t *dev)
|
|||||||
#endif
|
#endif
|
||||||
unsigned int status;
|
unsigned int status;
|
||||||
int nexthead = rxbuf->head + 1;
|
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;
|
int signo = 0;
|
||||||
#endif
|
#endif
|
||||||
uint16_t nbytes = 0;
|
uint16_t nbytes = 0;
|
||||||
@@ -233,13 +233,13 @@ void uart_recvchars(FAR uart_dev_t *dev)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_TTY_SIGSTP
|
#ifdef CONFIG_TTY_SIGTSTP
|
||||||
/* Is this the special character that will generate the SIGSTP
|
/* Is this the special character that will generate the SIGTSTP
|
||||||
* signal?
|
* signal?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (dev->pid >= 0 && (dev->tc_lflag & ISIG) &&
|
if (dev->pid >= 0 && (dev->tc_lflag & ISIG) &&
|
||||||
ch == CONFIG_TTY_SIGSTP_CHAR)
|
ch == CONFIG_TTY_SIGTSTP_CHAR)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_TTY_SIGINT
|
#ifdef CONFIG_TTY_SIGINT
|
||||||
/* Give precedence to 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.
|
* into the Rx buffer. It should not be read as normal data.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
signo = SIGSTP;
|
signo = SIGTSTP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -292,7 +292,7 @@ void uart_recvchars(FAR uart_dev_t *dev)
|
|||||||
uart_datareceived(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 */
|
/* Send the signal if necessary */
|
||||||
|
|
||||||
if (signo != 0)
|
if (signo != 0)
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ struct uart_dev_s
|
|||||||
tcflag_t tc_iflag; /* Input modes */
|
tcflag_t tc_iflag; /* Input modes */
|
||||||
tcflag_t tc_oflag; /* Output modes */
|
tcflag_t tc_oflag; /* Output modes */
|
||||||
tcflag_t tc_lflag; /* Local 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) */
|
pid_t pid; /* Thread PID to receive signals (-1 if none) */
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-1
@@ -168,7 +168,7 @@
|
|||||||
|
|
||||||
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
||||||
# define SIGSTOP CONFIG_SIG_STOP
|
# define SIGSTOP CONFIG_SIG_STOP
|
||||||
# define SIGSTP CONFIG_SIG_STP
|
# define SIGTSTP CONFIG_SIG_TSTP
|
||||||
# define SIGCONT CONFIG_SIG_CONT
|
# define SIGCONT CONFIG_SIG_CONT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -143,9 +143,9 @@ FAR char *strsignal(int signum)
|
|||||||
return (FAR char *)"SIGSTOP";
|
return (FAR char *)"SIGSTOP";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SIGSTP
|
#ifdef SIGTSTP
|
||||||
case SIGSTP:
|
case SIGTSTP:
|
||||||
return (FAR char *)"SIGSTP";
|
return (FAR char *)"SIGTSTP";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SIGCONT
|
#ifdef SIGCONT
|
||||||
|
|||||||
+4
-4
@@ -1382,10 +1382,10 @@ config SIG_SIGPOLL_ACTION
|
|||||||
sigaction() to ignore SIGPOLL.
|
sigaction() to ignore SIGPOLL.
|
||||||
|
|
||||||
config SIG_SIGSTOP_ACTION
|
config SIG_SIGSTOP_ACTION
|
||||||
bool "SIGSTOP SIGSTP, and SIGCONT"
|
bool "SIGSTOP SIGTSTP, and SIGCONT"
|
||||||
default y
|
default y
|
||||||
---help---
|
---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).
|
task) and SIGCONT (resume the task).
|
||||||
|
|
||||||
config SIG_SIGKILL_ACTION
|
config SIG_SIGKILL_ACTION
|
||||||
@@ -1452,8 +1452,8 @@ config SIG_STOP
|
|||||||
---help---
|
---help---
|
||||||
Suspend/pause a task. SIGSTOP may not be caught or ignored.
|
Suspend/pause a task. SIGSTOP may not be caught or ignored.
|
||||||
|
|
||||||
config SIG_STP
|
config SIG_TSTP
|
||||||
int "SIGSTP"
|
int "SIGTSTP"
|
||||||
default 7
|
default 7
|
||||||
depends on SIG_SIGSTOP_ACTION
|
depends on SIG_SIGSTOP_ACTION
|
||||||
---help---
|
---help---
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ static int group_suspend_children_handler(pid_t pid, FAR void *arg)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Suspend all children of a task except for the specified task. This is
|
* 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.
|
* suspended, all of its child pthreads must also be suspended.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ volatile dq_queue_t g_waitingforfill;
|
|||||||
|
|
||||||
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
||||||
/* This is the list of all tasks that have been stopped
|
/* 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;
|
volatile dq_queue_t g_stoppedtasks;
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ static const struct nxsig_defaction_s g_defactions[] =
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
||||||
{ SIGSTOP, SIG_FLAG_NOCATCH, nxsig_stop_task },
|
{ SIGSTOP, SIG_FLAG_NOCATCH, nxsig_stop_task },
|
||||||
{ SIGSTP, 0, nxsig_stop_task },
|
{ SIGTSTP, 0, nxsig_stop_task },
|
||||||
{ SIGCONT, SIG_FLAG_NOCATCH, nxsig_null_action },
|
{ SIGCONT, SIG_FLAG_NOCATCH, nxsig_null_action },
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
#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.
|
* if SIGCONT is received.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user