summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Campbell <lambda@continuation.org>2016-01-31 22:04:05 -0500
committerBrian Campbell <lambda@continuation.org>2016-01-31 22:04:05 -0500
commitd81e4a0ad89d8d9460dbede5446eddd4b0297450 (patch)
tree8043274715f7f33ef5a8a20b2c7e8d646049918d
parent30f70baa6cc1ba3ddebb55b988fafbad0c0cc810 (diff)
downloadrust-libc-d81e4a0ad89d8d9460dbede5446eddd4b0297450.tar.gz
Add abort
This is defined by the C standard to indicate abnormal program terminaiton; it is defined to call raise(SIGABRT), and to not return. This can be useful when panics are not an option, such as signal handlers handling stack overflow.
-rw-r--r--src/lib.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 3f3133fafc..bcb83fcb5d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -206,6 +206,7 @@ extern {
pub fn malloc(size: size_t) -> *mut c_void;
pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
pub fn free(p: *mut c_void);
+ pub fn abort() -> !;
pub fn exit(status: c_int) -> !;
pub fn _exit(status: c_int) -> !;
pub fn atexit(cb: extern fn()) -> c_int;