about summary refs log tree commit diff
path: root/src/libstd/libc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/libc.rs')
-rw-r--r--src/libstd/libc.rs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libstd/libc.rs b/src/libstd/libc.rs
index 972002fe34e..83a95952e02 100644
--- a/src/libstd/libc.rs
+++ b/src/libstd/libc.rs
@@ -266,6 +266,8 @@ pub mod types {
                 }
 
                 pub enum timezone {}
+
+                pub type sighandler_t = size_t;
             }
             pub mod bsd44 {
                 use libc::types::os::arch::c95::{c_char, c_int, c_uint};
@@ -637,6 +639,8 @@ pub mod types {
                 }
 
                 pub enum timezone {}
+
+                pub type sighandler_t = size_t;
             }
             pub mod bsd44 {
                 use libc::types::os::arch::c95::{c_char, c_int, c_uint};
@@ -1206,6 +1210,8 @@ pub mod types {
                 }
 
                 pub enum timezone {}
+
+                pub type sighandler_t = size_t;
             }
 
             pub mod bsd44 {
@@ -2292,6 +2298,8 @@ pub mod consts {
             use libc::types::os::arch::c95::{c_int, size_t};
 
             pub static SIGTRAP : c_int = 5;
+            pub static SIGPIPE: c_int = 13;
+            pub static SIG_IGN: size_t = 1;
 
             pub static GLOB_ERR      : c_int = 1 << 0;
             pub static GLOB_MARK     : c_int = 1 << 1;
@@ -2743,6 +2751,8 @@ pub mod consts {
             use libc::types::os::arch::c95::{c_int, size_t};
 
             pub static SIGTRAP : c_int = 5;
+            pub static SIGPIPE: c_int = 13;
+            pub static SIG_IGN: size_t = 1;
 
             pub static GLOB_APPEND   : c_int = 0x0001;
             pub static GLOB_DOOFFS   : c_int = 0x0002;
@@ -3140,6 +3150,8 @@ pub mod consts {
             use libc::types::os::arch::c95::{c_int, size_t};
 
             pub static SIGTRAP : c_int = 5;
+            pub static SIGPIPE: c_int = 13;
+            pub static SIG_IGN: size_t = 1;
 
             pub static GLOB_APPEND   : c_int = 0x0001;
             pub static GLOB_DOOFFS   : c_int = 0x0002;
@@ -3844,6 +3856,24 @@ pub mod funcs {
             }
         }
 
+        pub mod signal {
+            use libc::types::os::arch::c95::c_int;
+            use libc::types::os::common::posix01::sighandler_t;
+
+            #[cfg(not(target_os = "android"))]
+            extern {
+                pub fn signal(signum: c_int,
+                              handler: sighandler_t) -> sighandler_t;
+            }
+
+            #[cfg(target_os = "android")]
+            extern {
+                #[link_name = "bsd_signal"]
+                pub fn signal(signum: c_int,
+                              handler: sighandler_t) -> sighandler_t;
+            }
+        }
+
         pub mod wait {
             use libc::types::os::arch::c95::{c_int};
             use libc::types::os::arch::posix88::{pid_t};