MCPcopy Index your code
hub / github.com/RustPython/RustPython / faulthandler_enable_internal

Function faulthandler_enable_internal

crates/stdlib/src/faulthandler.rs:666–692  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

664 // faulthandler_enable
665 #[cfg(unix)]
666 fn faulthandler_enable_internal() -> bool {
667 if FATAL_ERROR.enabled.load(Ordering::Relaxed) {
668 return true;
669 }
670
671 unsafe {
672 for handler in FAULTHANDLER_HANDLERS.iter_mut() {
673 if handler.enabled {
674 continue;
675 }
676
677 let mut action: libc::sigaction = core::mem::zeroed();
678 action.sa_sigaction = faulthandler_fatal_error as *const () as libc::sighandler_t;
679 // SA_NODEFER flag
680 action.sa_flags = libc::SA_NODEFER;
681
682 if libc::sigaction(handler.signum, &action, &mut handler.previous) != 0 {
683 return false;
684 }
685
686 handler.enabled = true;
687 }
688 }
689
690 FATAL_ERROR.enabled.store(true, Ordering::Relaxed);
691 true
692 }
693
694 #[cfg(windows)]
695 fn faulthandler_enable_internal() -> bool {

Callers 1

enableFunction · 0.85

Calls 5

signalFunction · 0.50
SomeClass · 0.50
loadMethod · 0.45
iter_mutMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected