mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38: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:
parent
7b89845035
commit
b2f8a79c3b
3 changed files with 26 additions and 2 deletions
|
@ -92,7 +92,7 @@
|
|||
* SIGILL A Illegal instruction
|
||||
* SIGINT T (3) Terminal interrupt signal
|
||||
* 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
|
||||
* SIGSEGV A Invalid memory reference
|
||||
* 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
|
||||
* (5) The default action can be enabled with CONFIG_SIG_SIGUSR2_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
|
||||
|
@ -190,6 +191,12 @@
|
|||
# define SIGINT CONFIG_SIG_INT
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_SIG_SIGPIPE
|
||||
# define SIGPIPE 11
|
||||
#else
|
||||
# define SIGPIPE CONFIG_SIG_SIGPIPE
|
||||
#endif
|
||||
|
||||
/* The following are non-standard signal definitions */
|
||||
|
||||
#ifndef CONFIG_DISABLE_PTHREAD
|
||||
|
|
|
@ -1414,6 +1414,12 @@ config SIG_SIGKILL_ACTION
|
|||
Enable the default action for SIGINT and SIGKILL (terminate the
|
||||
task).
|
||||
|
||||
config SIG_SIGPIPE_ACTION
|
||||
bool "SIGPIPE"
|
||||
default y
|
||||
---help---
|
||||
Enable the default action for SIGPIPE (terminate the task).
|
||||
|
||||
endif # SIG_DEFAULT
|
||||
|
||||
menu "Signal Numbers"
|
||||
|
@ -1500,6 +1506,14 @@ config SIG_INT
|
|||
|
||||
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"
|
||||
|
||||
config SIG_SIGCONDTIMEDOUT
|
||||
|
|
|
@ -138,7 +138,10 @@ static const struct nxsig_defaction_s g_defactions[] =
|
|||
#endif
|
||||
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
||||
{ 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
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue