Function attachSegfaultHandler [src]

Attaches a global SIGSEGV handler which calls @panic("segmentation fault");

Prototype

pub fn attachSegfaultHandler() void

Source

pub fn attachSegfaultHandler() void { if (!have_segfault_handling_support) { @compileError("segfault handler not supported for this target"); } if (native_os == .windows) { windows_segfault_handle = windows.kernel32.AddVectoredExceptionHandler(0, handleSegfaultWindows); return; } var act = posix.Sigaction{ .handler = .{ .sigaction = handleSegfaultPosix }, .mask = posix.empty_sigset, .flags = (posix.SA.SIGINFO | posix.SA.RESTART | posix.SA.RESETHAND), }; updateSegfaultHandler(&act); }