about summary refs log tree commit diff
path: root/src/libstd/sys/unix
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2016-09-30 23:07:04 +0000
committerBrian Anderson <banderson@mozilla.com>2016-11-01 17:08:24 +0000
commitf3a709dc52bb3e617ccb016a8b20a741c23da77d (patch)
tree7ce55285f2b9d329dadb0bb11dcb2abb8d55fa7b /src/libstd/sys/unix
parent219c018894b31fec7059ca89bb1ab0606068aeaf (diff)
downloadrust-f3a709dc52bb3e617ccb016a8b20a741c23da77d.tar.gz
rust-f3a709dc52bb3e617ccb016a8b20a741c23da77d.zip
std: Move platform-specific out of sys_common::util
Diffstat (limited to 'src/libstd/sys/unix')
-rw-r--r--src/libstd/sys/unix/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs
index 0e28426b32f..fd7dc17cccd 100644
--- a/src/libstd/sys/unix/mod.rs
+++ b/src/libstd/sys/unix/mod.rs
@@ -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()
+}