diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -365,6 +365,16 @@ SIGFILLSET(fastblock_mask); SIG_CANTMASK(fastblock_mask); ast_register(TDA_SIG, ASTR_UNCOND, 0, ast_sig); + + /* + * TDA_PSELECT is for the case where the signal mask should be restored + * before delivering any signals so that we do not deliver any that are + * blocked by the normal thread mask. It is mutually exclusive with + * TDA_SIGSUSPEND, which should be used if we *do* want to deliver + * signals that are normally blocked, e.g., if it interrupted our sleep. + */ + ast_register(TDA_PSELECT, ASTR_ASTF_REQUIRED | ASTR_TDP, + TDP_OLDMASK, ast_sigsuspend); ast_register(TDA_SIGSUSPEND, ASTR_ASTF_REQUIRED | ASTR_TDP, TDP_OLDMASK, ast_sigsuspend); } diff --git a/sys/sys/param.h b/sys/sys/param.h --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -73,7 +73,7 @@ * cannot include sys/param.h and should only be updated here. */ #undef __FreeBSD_version -#define __FreeBSD_version 1500027 +#define __FreeBSD_version 1500028 /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, diff --git a/sys/sys/proc.h b/sys/sys/proc.h --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -494,6 +494,7 @@ TDA_RACCT, TDA_MOD1, /* For third party use, before signals are */ TAD_MOD2, /* processed .. */ + TDA_PSELECT, /* For discarding temporary signal mask */ TDA_SIG, TDA_KTRACE, TDA_SUSPEND,