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

Function suppress_crash_report

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

Source from the content-addressed store, hash-verified

1262
1263 #[cfg(not(target_arch = "wasm32"))]
1264 fn suppress_crash_report() {
1265 #[cfg(windows)]
1266 {
1267 use windows_sys::Win32::System::Diagnostics::Debug::{
1268 SEM_NOGPFAULTERRORBOX, SetErrorMode,
1269 };
1270 unsafe {
1271 let mode = SetErrorMode(SEM_NOGPFAULTERRORBOX);
1272 SetErrorMode(mode | SEM_NOGPFAULTERRORBOX);
1273 }
1274 }
1275
1276 #[cfg(unix)]
1277 {
1278 // Disable core dumps
1279 #[cfg(not(any(target_os = "redox", target_os = "wasi")))]
1280 {
1281 use libc::{RLIMIT_CORE, rlimit, setrlimit};
1282 let rl = rlimit {
1283 rlim_cur: 0,
1284 rlim_max: 0,
1285 };
1286 unsafe {
1287 let _ = setrlimit(RLIMIT_CORE, &rl);
1288 }
1289 }
1290 }
1291 }
1292
1293 // Windows-specific constants
1294 #[cfg(windows)]

Callers 6

_read_nullFunction · 0.85
_sigsegvFunction · 0.85
_sigabrtFunction · 0.85
_sigfpeFunction · 0.85
_fatal_error_c_threadFunction · 0.85
_raise_exceptionFunction · 0.85

Calls 2

SetErrorModeFunction · 0.85
setrlimitFunction · 0.85

Tested by

no test coverage detected