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 <fangxinyong@xiaomi.com>
This commit is contained in:
parent
7462b199bb
commit
ffa084f3d2
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#define MIN_SIGNO 1 /* Lowest valid signal number */
|
#define MIN_SIGNO 1 /* Lowest valid signal number */
|
||||||
#define MAX_SIGNO 63 /* Highest valid signal number */
|
#define MAX_SIGNO 63 /* Highest valid signal number */
|
||||||
#define GOOD_SIGNO(s) ((((unsigned)(s)) <= MAX_SIGNO))
|
|
||||||
|
|
||||||
/* Definitions for "standard" signals */
|
/* Definitions for "standard" signals */
|
||||||
|
|
||||||
@ -236,7 +235,10 @@
|
|||||||
# define SIG_HOLD ((_sa_handler_t)1) /* Used only with sigset() */
|
# define SIG_HOLD ((_sa_handler_t)1) /* Used only with sigset() */
|
||||||
#endif
|
#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
|
* Public Types
|
||||||
|
@ -101,7 +101,7 @@ _sa_handler_t sigset(int signo, _sa_handler_t func)
|
|||||||
sigset_t set;
|
sigset_t set;
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
|
|
||||||
if (signo == SIGKILL || signo == SIGSTOP || !GOOD_SIGNO(signo))
|
if (!GOOD_SIGNO(signo) || UNCAUGHT_SIGNO(signo))
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ _sa_handler_t signal(int signo, _sa_handler_t func)
|
|||||||
struct sigaction oact;
|
struct sigaction oact;
|
||||||
int ret = -EINVAL;
|
int ret = -EINVAL;
|
||||||
|
|
||||||
if (!GOOD_SIGNO(signo))
|
if (!GOOD_SIGNO(signo) || UNCAUGHT_SIGNO(signo))
|
||||||
{
|
{
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user