mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
signal: add SIGQUIT & SIGTERM support
SIGQUIT SIGTERM are equal with SIGINT now Change-Id: Iefc084d58db28003dc40a17f1ff3fbd7a0b716ed
This commit is contained in:
@@ -175,6 +175,8 @@
|
|||||||
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
#ifdef CONFIG_SIG_SIGKILL_ACTION
|
||||||
# define SIGKILL CONFIG_SIG_KILL
|
# define SIGKILL CONFIG_SIG_KILL
|
||||||
# define SIGINT CONFIG_SIG_INT
|
# define SIGINT CONFIG_SIG_INT
|
||||||
|
# define SIGQUIT CONFIG_SIG_QUIT
|
||||||
|
# define SIGTERM CONFIG_SIG_TERM
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_SIG_SIGPIPE
|
#ifndef CONFIG_SIG_SIGPIPE
|
||||||
|
|||||||
@@ -163,6 +163,16 @@ FAR char *strsignal(int signum)
|
|||||||
return (FAR char *)"SIGINT";
|
return (FAR char *)"SIGINT";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef SIGQUIT
|
||||||
|
case SIGQUIT:
|
||||||
|
return (FAR char *)"SIGQUIT";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SIGTERM
|
||||||
|
case SIGTERM:
|
||||||
|
return (FAR char *)"SIGTERM";
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Non-standard signals */
|
/* Non-standard signals */
|
||||||
|
|
||||||
#ifdef SIGCONDTIMEDOUT
|
#ifdef SIGCONDTIMEDOUT
|
||||||
|
|||||||
+17
-1
@@ -1353,7 +1353,7 @@ config SIG_SIGSTOP_ACTION
|
|||||||
task) and SIGCONT (resume the task).
|
task) and SIGCONT (resume the task).
|
||||||
|
|
||||||
config SIG_SIGKILL_ACTION
|
config SIG_SIGKILL_ACTION
|
||||||
bool "SIGINT and SIGKILL"
|
bool "SIGINT SIGKILL SIGQUIT and SIGTERM"
|
||||||
default y
|
default y
|
||||||
---help---
|
---help---
|
||||||
Enable the default action for SIGINT and SIGKILL (terminate the
|
Enable the default action for SIGINT and SIGKILL (terminate the
|
||||||
@@ -1449,6 +1449,22 @@ config SIG_INT
|
|||||||
The SIGINT signal is sent to cause a task termination event.
|
The SIGINT signal is sent to cause a task termination event.
|
||||||
SIGINT may be ignored or caught by the receiving task.
|
SIGINT may be ignored or caught by the receiving task.
|
||||||
|
|
||||||
|
config SIG_QUIT
|
||||||
|
int "SIGQUIT"
|
||||||
|
default 11
|
||||||
|
depends on SIG_SIGKILL_ACTION
|
||||||
|
---help---
|
||||||
|
The SIGINT signal is sent to cause a task termination event.
|
||||||
|
SIGQUIT may be ignored or caught by the receiving task.
|
||||||
|
|
||||||
|
config SIG_TERM
|
||||||
|
int "SIGTERM"
|
||||||
|
default 12
|
||||||
|
depends on SIG_SIGKILL_ACTION
|
||||||
|
---help---
|
||||||
|
The SIGINT signal is sent to cause a task termination event.
|
||||||
|
SIGTERM may be ignored or caught by the receiving task.
|
||||||
|
|
||||||
endif # SIG_DEFAULT
|
endif # SIG_DEFAULT
|
||||||
|
|
||||||
config SIG_PIPE
|
config SIG_PIPE
|
||||||
|
|||||||
@@ -140,6 +140,8 @@ static const struct nxsig_defaction_s g_defactions[] =
|
|||||||
#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 },
|
||||||
|
{ SIGQUIT, 0, nxsig_abnormal_termination },
|
||||||
|
{ SIGTERM, 0, nxsig_abnormal_termination },
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SIG_SIGPIPE_ACTION
|
#ifdef CONFIG_SIG_SIGPIPE_ACTION
|
||||||
{ SIGPIPE, 0, nxsig_abnormal_termination }
|
{ SIGPIPE, 0, nxsig_abnormal_termination }
|
||||||
|
|||||||
Reference in New Issue
Block a user