Lines Matching refs:signo
224 static bool GetHandlingSignal(int signo) { in GetHandlingSignal() argument
225 size_t bit_idx = signo - 1; in GetHandlingSignal()
233 static bool SetHandlingSignal(int signo, bool value) { in SetHandlingSignal() argument
236 size_t bit_idx = signo - 1; in SetHandlingSignal()
255 ScopedHandlingSignal(int signo, bool set) in ScopedHandlingSignal() argument
256 : signo_(signo), in ScopedHandlingSignal()
257 original_value_(set ? SetHandlingSignal(signo, true) : GetHandlingSignal(signo)) {} in ScopedHandlingSignal()
277 void Claim(int signo) { in Claim() argument
279 Register(signo); in Claim()
285 void Register(int signo) { in Register() argument
299 linked_sigaction64(signo, &handler_action, &action_); in Register()
300 linked_sigaction64(signo, nullptr, &handler_action); in Register()
302 linked_sigaction(signo, &handler_action, &action_); in Register()
303 linked_sigaction(signo, nullptr, &handler_action); in Register()
405 static void Handler(int signo, siginfo_t* siginfo, void*);
430 void SignalChain::Handler(int signo, siginfo_t* siginfo, void* ucontext_raw) { in Handler() argument
433 if (!GetHandlingSignal(signo)) { in Handler()
434 for (const auto& handler : chains[signo].special_handlers_) { in Handler()
446 ScopedHandlingSignal restorer(signo, !handler_noreturn); in Handler()
448 if (handler.sc_sigaction(signo, siginfo, ucontext_raw)) { in Handler()
459 size_t bit_idx = signo - 1; in Handler()
467 signo, in Handler()
489 if (android_handle_signal != nullptr && android_handle_signal(signo, siginfo, ucontext_raw)) { in Handler()
494 int handler_flags = chains[signo].action_.sa_flags; in Handler()
498 sigorset(&mask, &ucontext->uc_sigmask64, &chains[signo].action_.sa_mask); in Handler()
501 sigorset(&mask, &ucontext->uc_sigmask, &chains[signo].action_.sa_mask); in Handler()
504 sigaddset(&mask, signo); in Handler()
518 (signo == SIGILL || signo == SIGFPE || signo == SIGSEGV || in Handler()
519 signo == SIGBUS || signo == SIGTRAP) && in Handler()
521 !(signo == SIGTRAP && siginfo->si_code == TRAP_HWBKPT)) { in Handler()
525 chains[signo].action_.sa_sigaction(signo, siginfo, ucontext_raw); in Handler()
527 auto handler = chains[signo].action_.sa_handler; in Handler()
535 LogError("reverting to SIG_DFL handler for signal %d, ucontext %p", signo, ucontext); in Handler()
539 linked_sigaction(signo, &dfl, nullptr); in Handler()
542 handler(signo); in Handler()
600 extern "C" sighandler_t signal(int signo, sighandler_t handler) { in signal() argument
603 if (signo <= 0 || signo >= _NSIG) { in signal()
616 if (chains[signo].IsClaimed()) { in signal()
618 chains[signo].GetAction<struct sigaction>().sa_handler); in signal()
619 chains[signo].SetAction(&sa); in signal()
625 if (linked_sigaction(signo, &sa, &sa) == -1) { in signal()
633 extern "C" sighandler_t bsd_signal(int signo, sighandler_t handler) { in bsd_signal() argument
636 return signal(signo, handler); in bsd_signal()