Lines Matching refs:handler
40 let mut handler: libc::sigaction = unsafe { mem::zeroed() };
43 handler.sa_sigaction = new_action;
44 handler.sa_flags = libc::SA_RESTART | libc::SA_SIGINFO;
47 if libc::sigaction(sig_num, &handler, &mut old_act) != 0 {
62 // sig_info should not be null, but in a sig handler we cannot panic directly,
73 // There could be a race condition between swapping the old handler with the new
74 // handler and storing the change back to the global during the register
75 // procedure. Because of the race condition, the old handler and the new
77 // store the old handler into global before swapping the handler in
78 // register. And during the handler execution, if the the action
79 // of the signal cannot be found, we execute this old handler instead if the
88 let handler = act.sa_sigaction;
92 if handler == libc::SIG_DFL || handler == libc::SIG_IGN {
96 // If SA_SIGINFO flag is set, then the signal handler takes three arguments, not
98 // We transmute the handler from ptr to actual function type according to
101 let action = unsafe { mem::transmute::<usize, extern "C" fn(c_int)>(handler) };
105 let action = unsafe { mem::transmute::<usize, Action>(handler) };