()
| 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)] |
no test coverage detected