You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/07/12 13:27:12 UTC
[nuttx] branch master updated (3d5eae2497 -> ffa084f3d2)
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
from 3d5eae2497 arch/arm64: Enable FPU for qemu-armv8a:netnsh_smp and netnsh_smp_hv
new 7462b199bb signal: SIGCONT can be caught
new ffa084f3d2 signal: SIGKILL or SIGSTOP cannot be caught
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
include/signal.h | 6 ++++--
libs/libc/signal/sig_set.c | 2 +-
libs/libc/signal/sig_signal.c | 2 +-
sched/signal/sig_default.c | 2 +-
4 files changed, 7 insertions(+), 5 deletions(-)
[nuttx] 02/02: signal: SIGKILL or SIGSTOP cannot be caught
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit ffa084f3d27f8c636ca9f6a8e4b94c36bf2487f9
Author: fangxinyong <fa...@xiaomi.com>
AuthorDate: Sat Jun 24 18:19:25 2023 +0800
signal: SIGKILL or SIGSTOP cannot be caught
pass ltp signal test cases, for posix spec, SIGKILL and SIGSTOP cannot be caught.
https://pubs.opengroup.org/onlinepubs/9699919799/functions/signal.html
https://pubs.opengroup.org/onlinepubs/007904875/functions/sigset.html
Signed-off-by: fangxinyong <fa...@xiaomi.com>
---
include/signal.h | 6 ++++--
libs/libc/signal/sig_set.c | 2 +-
libs/libc/signal/sig_signal.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/signal.h b/include/signal.h
index fa00c94119..7318a334d3 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -39,7 +39,6 @@
#define MIN_SIGNO 1 /* Lowest valid signal number */
#define MAX_SIGNO 63 /* Highest valid signal number */
-#define GOOD_SIGNO(s) ((((unsigned)(s)) <= MAX_SIGNO))
/* Definitions for "standard" signals */
@@ -236,7 +235,10 @@
# define SIG_HOLD ((_sa_handler_t)1) /* Used only with sigset() */
#endif
-#define tkill(tid, signo) tgkill((pid_t)-1, tid, signo)
+#define GOOD_SIGNO(s) (((unsigned)(s)) <= MAX_SIGNO)
+#define UNCAUGHT_SIGNO(s) ((s) == SIGKILL || (s) == SIGSTOP)
+
+#define tkill(tid, signo) tgkill((pid_t)-1, tid, signo)
/****************************************************************************
* Public Types
diff --git a/libs/libc/signal/sig_set.c b/libs/libc/signal/sig_set.c
index 24b0fc34ee..3b78f6bc1f 100644
--- a/libs/libc/signal/sig_set.c
+++ b/libs/libc/signal/sig_set.c
@@ -101,7 +101,7 @@ _sa_handler_t sigset(int signo, _sa_handler_t func)
sigset_t set;
int ret = -EINVAL;
- if (signo == SIGKILL || signo == SIGSTOP || !GOOD_SIGNO(signo))
+ if (!GOOD_SIGNO(signo) || UNCAUGHT_SIGNO(signo))
{
goto err;
}
diff --git a/libs/libc/signal/sig_signal.c b/libs/libc/signal/sig_signal.c
index 5dbcf9faae..d16191042b 100644
--- a/libs/libc/signal/sig_signal.c
+++ b/libs/libc/signal/sig_signal.c
@@ -62,7 +62,7 @@ _sa_handler_t signal(int signo, _sa_handler_t func)
struct sigaction oact;
int ret = -EINVAL;
- if (!GOOD_SIGNO(signo))
+ if (!GOOD_SIGNO(signo) || UNCAUGHT_SIGNO(signo))
{
goto err;
}
[nuttx] 01/02: signal: SIGCONT can be caught
Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 7462b199bb68cf4f3c6d52ced25d6016fb85295f
Author: fangxinyong <fa...@xiaomi.com>
AuthorDate: Sat Jun 24 20:57:11 2023 +0800
signal: SIGCONT can be caught
pass ltp sigaction case 19-5.c, 23-5,c and 28-5.c.
When SIGCONT is dispatched, resume all members of the task group.
So there is nothing do in default action.
Signed-off-by: fangxinyong <fa...@xiaomi.com>
---
sched/signal/sig_default.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c
index f49c131f4d..0bc8b9ba2e 100644
--- a/sched/signal/sig_default.c
+++ b/sched/signal/sig_default.c
@@ -135,7 +135,7 @@ static const struct nxsig_defaction_s g_defactions[] =
{ SIGVTALRM, 0, nxsig_abnormal_termination },
#endif
#ifdef CONFIG_SIG_SIGSTOP_ACTION
- { SIGCONT, SIG_FLAG_NOCATCH, nxsig_null_action },
+ { SIGCONT, 0, nxsig_null_action },
{ SIGSTOP, SIG_FLAG_NOCATCH, nxsig_stop_task },
{ SIGTSTP, 0, nxsig_stop_task },
{ SIGTTIN, 0, nxsig_stop_task },