mirror of
https://github.com/apache/nuttx.git
synced 2025-12-13 15:12:38 +08:00
sched/signal: Add support for SIGPIPE. SIGPIPE uses SIG_SIGPIPE_ACTION which terminates process by default. It also could be ignored.
This commit is contained in:
@@ -92,7 +92,7 @@
|
|||||||
* SIGILL A Illegal instruction
|
* SIGILL A Illegal instruction
|
||||||
* SIGINT T (3) Terminal interrupt signal
|
* SIGINT T (3) Terminal interrupt signal
|
||||||
* SIGKILL T (3) Kill (cannot be caught or ignored)
|
* SIGKILL T (3) Kill (cannot be caught or ignored)
|
||||||
* SIGPIPE T Write on a pipe with no one to read it
|
* SIGPIPE T (7) Write on a pipe with no one to read it
|
||||||
* SIGQUIT A Terminal quit signal
|
* SIGQUIT A Terminal quit signal
|
||||||
* SIGSEGV A Invalid memory reference
|
* SIGSEGV A Invalid memory reference
|
||||||
* SIGSTOP S (2) Stop executing (cannot be caught or ignored)
|
* SIGSTOP S (2) Stop executing (cannot be caught or ignored)
|
||||||
@@ -132,6 +132,7 @@
|
|||||||
* (4) The default action can be enabled with CONFIG_SIG_SIGUSR1_ACTION
|
* (4) The default action can be enabled with CONFIG_SIG_SIGUSR1_ACTION
|
||||||
* (5) The default action can be enabled with CONFIG_SIG_SIGUSR2_ACTION
|
* (5) The default action can be enabled with CONFIG_SIG_SIGUSR2_ACTION
|
||||||
* (6) The default action can be enabled with CONFIG_SIG_SIGPOLL_ACTION
|
* (6) The default action can be enabled with CONFIG_SIG_SIGPOLL_ACTION
|
||||||
|
* (7) The default action can be enabled with CONFIG_SIG_SIGPIPE_ACTION
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* A few of the real time signals are used within the OS. They have
|
/* A few of the real time signals are used within the OS. They have
|
||||||
@@ -190,6 +191,12 @@
|
|||||||
# define SIGINT CONFIG_SIG_INT
|
# define SIGINT CONFIG_SIG_INT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_SIG_SIGPIPE
|
||||||
|
# define SIGPIPE 11
|
||||||
|
#else
|
||||||
|
# define SIGPIPE CONFIG_SIG_SIGPIPE
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The following are non-standard signal definitions */
|
/* The following are non-standard signal definitions */
|
||||||
|
|
||||||
#ifndef CONFIG_DISABLE_PTHREAD
|
#ifndef CONFIG_DISABLE_PTHREAD
|
||||||
|
|||||||
@@ -1414,6 +1414,12 @@ config SIG_SIGKILL_ACTION
|
|||||||
Enable the default action for SIGINT and SIGKILL (terminate the
|
Enable the default action for SIGINT and SIGKILL (terminate the
|
||||||
task).
|
task).
|
||||||
|
|
||||||
|
config SIG_SIGPIPE_ACTION
|
||||||
|
bool "SIGPIPE"
|
||||||
|
default y
|
||||||
|
---help---
|
||||||
|
Enable the default action for SIGPIPE (terminate the task).
|
||||||
|
|
||||||
endif # SIG_DEFAULT
|
endif # SIG_DEFAULT
|
||||||
|
|
||||||
menu "Signal Numbers"
|
menu "Signal Numbers"
|
||||||
@@ -1500,6 +1506,14 @@ config SIG_INT
|
|||||||
|
|
||||||
endif # SIG_DEFAULT
|
endif # SIG_DEFAULT
|
||||||
|
|
||||||
|
config SIG_PIPE
|
||||||
|
int "SIGPIPE"
|
||||||
|
default 11
|
||||||
|
---help---
|
||||||
|
The SIGPIPE signal is sent to a task termination event.
|
||||||
|
This signal is generated when write on a pipe with no one to read it.
|
||||||
|
SIGPIPE may be ignored.
|
||||||
|
|
||||||
comment "Non-standard Signal Numbers"
|
comment "Non-standard Signal Numbers"
|
||||||
|
|
||||||
config SIG_SIGCONDTIMEDOUT
|
config SIG_SIGCONDTIMEDOUT
|
||||||
|
|||||||
@@ -138,7 +138,10 @@ static const struct nxsig_defaction_s g_defactions[] =
|
|||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
||||||
{ SIGINT, 0, nxsig_abnormal_termination },
|
{ SIGINT, 0, nxsig_abnormal_termination },
|
||||||
{ SIGKILL, SIG_FLAG_NOCATCH, nxsig_abnormal_termination }
|
{ SIGKILL, SIG_FLAG_NOCATCH, nxsig_abnormal_termination },
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_SIG_SIGPIPE_ACTION
|
||||||
|
{ SIGPIPE, 0, nxsig_abnormal_termination }
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user