Lines Matching defs:handler
426 /// the execution of the handler.
431 /// The handler is reset back to the default at the moment the signal is
643 /// A signal handler.
669 /// The `SA_SIGINFO` bit in the `flags` argument is ignored (it will be set only if `handler`
672 pub fn new(handler: SigHandler, flags: SaFlags, mask: SigSet) -> SigAction {
673 unsafe fn install_sig(p: *mut libc::sigaction, handler: SigHandler) {
674 (*p).sa_sigaction = match handler {
686 install_sig(p, handler);
687 (*p).sa_flags = match handler {
709 /// Returns the action's handler.
710 pub fn handler(&self) -> SigHandler {
747 /// action for the given signal. If `sigaction` fails, no new signal handler is installed.
756 /// * There is also no guarantee that the old signal handler was installed
773 /// Installs `handler` for the given `signal`, returning the previous signal
774 /// handler. `signal` should only be used following another call to `signal` or
775 /// if the current handler is the default. The return value of `signal` is
776 /// undefined after setting the handler with [`sigaction`][SigActionFn].
780 /// If the pointer to the previous signal handler is invalid, undefined
792 /// Use a signal handler to set a flag variable:
809 /// let handler = SigHandler::Handler(handle_sigint);
810 /// unsafe { signal::signal(Signal::SIGINT, handler) }.unwrap();
816 /// Returns [`Error(Errno::EOPNOTSUPP)`] if `handler` is
826 pub unsafe fn signal(signal: Signal, handler: SigHandler) -> Result<SigHandler> {
828 let res = match handler {
831 SigHandler::Handler(handler) => libc::signal(signal, handler as libc::sighandler_t),
1296 assert_eq!(action_sig.handler(), handler_sig);
1304 assert_eq!(action_act.handler(), handler_act);
1307 assert_eq!(action_dfl.handler(), SigHandler::SigDfl);
1310 assert_eq!(action_ign.handler(), SigHandler::SigIgn);