libc::funcs::c95::stdlib::exit [] [src]

pub unsafe extern fn exit(status: c_int) -> !

Exits the running program in a possibly dangerous manner.

Unsafety

While this forces your program to exit, it does so in a way that has consequences. This will skip all unwinding code, which means that anything relying on unwinding for cleanup (such as flushing and closing a buffer to a file) may act in an unexpected way.

Examples

extern crate libc; fn main() { unsafe { libc::exit(1); } }
extern crate libc;

fn main() {
    unsafe {
        libc::exit(1);
    }
}