]> git.proxmox.com Git - rustc.git/blobdiff - src/libstd/sys/unix/mod.rs
Imported Upstream version 1.6.0+dfsg1
[rustc.git] / src / libstd / sys / unix / mod.rs
index 3a88f36399eb25e79d34e20cdd1a2cc9d08c6488..68b0c3d6b0ee7392ce9d81919e3f1bd1e4d6c0e5 100644 (file)
@@ -12,7 +12,6 @@
 #![allow(non_camel_case_types)]
 
 use io::{self, ErrorKind};
-use libc::funcs::posix01::signal::signal;
 use libc;
 use num::One;
 use ops::Neg;
@@ -29,7 +28,6 @@ use ops::Neg;
 #[cfg(target_os = "openbsd")]   pub use os::openbsd as platform;
 
 pub mod backtrace;
-pub mod c;
 pub mod condvar;
 pub mod ext;
 pub mod fd;
@@ -42,13 +40,14 @@ pub mod pipe;
 pub mod process;
 pub mod rwlock;
 pub mod stack_overflow;
-pub mod sync;
 pub mod thread;
 pub mod thread_local;
 pub mod time;
 pub mod stdio;
 
+#[cfg(not(target_os = "nacl"))]
 pub fn init() {
+    use libc::signal;
     // By default, some platforms will send a *signal* when an EPIPE error
     // would otherwise be delivered. This runtime doesn't install a SIGPIPE
     // handler, causing it to kill the program, which isn't exactly what we
@@ -60,6 +59,8 @@ pub fn init() {
         assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0);
     }
 }
+#[cfg(target_os = "nacl")]
+pub fn init() { }
 
 pub fn decode_error_kind(errno: i32) -> ErrorKind {
     match errno as libc::c_int {
@@ -75,7 +76,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
         libc::EINTR => ErrorKind::Interrupted,
         libc::EINVAL => ErrorKind::InvalidInput,
         libc::ETIMEDOUT => ErrorKind::TimedOut,
-        libc::consts::os::posix88::EEXIST => ErrorKind::AlreadyExists,
+        libc::EEXIST => ErrorKind::AlreadyExists,
 
         // These two constants can have the same value on some systems,
         // but different values on others, so we can't use a match