1
Fork 0

std: Move platform-specific out of sys_common::util

This commit is contained in:
Brian Anderson 2016-09-30 23:07:04 +00:00
parent 219c018894
commit f3a709dc52
4 changed files with 26 additions and 28 deletions

View file

@ -163,3 +163,14 @@ pub fn cvt_r<T, F>(mut f: F) -> io::Result<T>
}
}
}
// On Unix-like platforms, libc::abort will unregister signal handlers
// including the SIGABRT handler, preventing the abort from being blocked, and
// fclose streams, with the side effect of flushing them so libc bufferred
// output will be printed. Additionally the shell will generally print a more
// understandable error message like "Abort trap" rather than "Illegal
// instruction" that intrinsics::abort would cause, as intrinsics::abort is
// implemented as an illegal instruction.
pub unsafe fn abort_internal() -> ! {
::libc::abort()
}