diff options
Diffstat (limited to 'src/liblibc/lib.rs')
| -rw-r--r-- | src/liblibc/lib.rs | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index c866deafee4..0ad18e25329 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -13,6 +13,7 @@ #![cfg_attr(not(feature = "cargo-build"), unstable)] #![cfg_attr(not(feature = "cargo-build"), staged_api)] #![allow(unknown_features)] #![feature(int_uint)] +#![allow(unstable)] #![no_std] #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "http://www.rust-lang.org/favicon.ico", @@ -497,7 +498,8 @@ pub mod types { #[cfg(any(target_arch = "x86", target_arch = "arm", target_arch = "mips", - target_arch = "mipsel"))] + target_arch = "mipsel", + target_arch = "powerpc"))] pub mod arch { pub mod c95 { pub type c_char = i8; @@ -528,7 +530,8 @@ pub mod types { } #[cfg(any(target_arch = "x86", target_arch = "mips", - target_arch = "mipsel"))] + target_arch = "mipsel", + target_arch = "powerpc"))] pub mod posix88 { pub type off_t = i32; pub type dev_t = u64; @@ -642,7 +645,9 @@ pub mod types { pub __size: [u32; 9] } } - #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] + #[cfg(any(target_arch = "mips", + target_arch = "mipsel", + target_arch = "powerpc"))] pub mod posix01 { use types::os::arch::c95::{c_long, c_ulong, time_t}; use types::os::arch::posix88::{gid_t, ino_t}; @@ -2697,7 +2702,9 @@ pub mod consts { pub const EHWPOISON: c_int = 133; } - #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] + #[cfg(any(target_arch = "mips", + target_arch = "mipsel", + target_arch = "powerpc"))] pub mod posix88 { use types::os::arch::c95::c_int; use types::common::c95::c_void; @@ -2982,7 +2989,8 @@ pub mod consts { #[cfg(all(target_os = "linux", any(target_arch = "mips", target_arch = "mipsel", - target_arch = "aarch64")))] + target_arch = "aarch64", + target_arch = "powerpc")))] pub const PTHREAD_STACK_MIN: size_t = 131072; pub const CLOCK_REALTIME: c_int = 0; @@ -3040,7 +3048,9 @@ pub mod consts { pub const SHUT_WR: c_int = 1; pub const SHUT_RDWR: c_int = 2; } - #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] + #[cfg(any(target_arch = "mips", + target_arch = "mipsel", + target_arch = "powerpc"))] pub mod bsd44 { use types::os::arch::c95::c_int; @@ -3115,7 +3125,9 @@ pub mod consts { pub const MAP_NONBLOCK : c_int = 0x010000; pub const MAP_STACK : c_int = 0x020000; } - #[cfg(any(target_arch = "mips", target_arch = "mipsel"))] + #[cfg(any(target_arch = "mips", + target_arch = "mipsel", + target_arch = "powerpc"))] pub mod extra { use types::os::arch::c95::c_int; @@ -4157,6 +4169,27 @@ pub mod funcs { 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); + + /// 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 + /// + /// ```no_run + /// extern crate libc; + /// + /// fn main() { + /// unsafe { + /// libc::exit(1); + /// } + /// } + /// ``` pub fn exit(status: c_int) -> !; pub fn _exit(status: c_int) -> !; pub fn atexit(cb: extern fn()) -> c_int; |
