Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_sig.c
Show First 20 Lines • Show All 609 Lines • ▼ Show 20 Lines | signotify(struct thread *td) | ||||
if (SIGPENDING(td)) { | if (SIGPENDING(td)) { | ||||
thread_lock(td); | thread_lock(td); | ||||
td->td_flags |= TDF_NEEDSIGCHK | TDF_ASTPENDING; | td->td_flags |= TDF_NEEDSIGCHK | TDF_ASTPENDING; | ||||
thread_unlock(td); | thread_unlock(td); | ||||
} | } | ||||
} | } | ||||
/* | |||||
* Returns 1 (true) if altstack is configured for the thread, and the | |||||
* passed stack bottom address falls into the altstack range. Handles | |||||
* the 43 compat special case where the alt stack size is zero. | |||||
*/ | |||||
int | int | ||||
sigonstack(size_t sp) | sigonstack(size_t sp) | ||||
{ | { | ||||
struct thread *td = curthread; | struct thread *td; | ||||
return ((td->td_pflags & TDP_ALTSTACK) ? | td = curthread; | ||||
if ((td->td_pflags & TDP_ALTSTACK) == 0) | |||||
return (0); | |||||
#if defined(COMPAT_43) | #if defined(COMPAT_43) | ||||
((td->td_sigstk.ss_size == 0) ? | if (td->td_sigstk.ss_size == 0) | ||||
(td->td_sigstk.ss_flags & SS_ONSTACK) : | return ((td->td_sigstk.ss_flags & SS_ONSTACK) != 0); | ||||
((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size)) | |||||
#else | |||||
((sp - (size_t)td->td_sigstk.ss_sp) < td->td_sigstk.ss_size) | |||||
#endif | #endif | ||||
: 0); | return (sp >= (size_t)td->td_sigstk.ss_sp && | ||||
sp < td->td_sigstk.ss_size + (size_t)td->td_sigstk.ss_sp); | |||||
} | } | ||||
static __inline int | static __inline int | ||||
sigprop(int sig) | sigprop(int sig) | ||||
{ | { | ||||
if (sig > 0 && sig < nitems(sigproptbl)) | if (sig > 0 && sig < nitems(sigproptbl)) | ||||
return (sigproptbl[sig]); | return (sigproptbl[sig]); | ||||
▲ Show 20 Lines • Show All 3,192 Lines • Show Last 20 Lines |