use libc;
#[cfg(target_os = "macos")]
+#[cfg(target_os = "ios")]
#[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
pub static FIONBIO: libc::c_ulong = 0x8004667e;
-#[cfg(target_os = "linux", not(target_arch = "mips"))]
+#[cfg(target_os = "linux", target_arch = "x86")]
+#[cfg(target_os = "linux", target_arch = "x86_64")]
+#[cfg(target_os = "linux", target_arch = "arm")]
#[cfg(target_os = "android")]
pub static FIONBIO: libc::c_ulong = 0x5421;
#[cfg(target_os = "linux", target_arch = "mips")]
+#[cfg(target_os = "linux", target_arch = "mipsel")]
pub static FIONBIO: libc::c_ulong = 0x667e;
#[cfg(target_os = "macos")]
+#[cfg(target_os = "ios")]
#[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
pub static FIOCLEX: libc::c_ulong = 0x20006601;
-#[cfg(target_os = "linux", not(target_arch = "mips"))]
+#[cfg(target_os = "linux", target_arch = "x86")]
+#[cfg(target_os = "linux", target_arch = "x86_64")]
+#[cfg(target_os = "linux", target_arch = "arm")]
#[cfg(target_os = "android")]
pub static FIOCLEX: libc::c_ulong = 0x5451;
#[cfg(target_os = "linux", target_arch = "mips")]
+#[cfg(target_os = "linux", target_arch = "mipsel")]
pub static FIOCLEX: libc::c_ulong = 0x6601;
#[cfg(target_os = "macos")]
+#[cfg(target_os = "ios")]
#[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
pub static MSG_DONTWAIT: libc::c_int = 0x80;
#[cfg(target_os = "linux")]
#[cfg(target_os = "android")]
extern {
pub fn gettimeofday(timeval: *mut libc::timeval,
- tzp: *libc::c_void) -> libc::c_int;
+ tzp: *mut libc::c_void) -> libc::c_int;
pub fn select(nfds: libc::c_int,
- readfds: *fd_set,
- writefds: *fd_set,
- errorfds: *fd_set,
- timeout: *libc::timeval) -> libc::c_int;
+ readfds: *mut fd_set,
+ writefds: *mut fd_set,
+ errorfds: *mut fd_set,
+ timeout: *mut libc::timeval) -> libc::c_int;
pub fn getsockopt(sockfd: libc::c_int,
level: libc::c_int,
optname: libc::c_int,
options: libc::c_int) -> libc::pid_t;
pub fn sigaction(signum: libc::c_int,
- act: *sigaction,
+ act: *const sigaction,
oldact: *mut sigaction) -> libc::c_int;
pub fn sigaddset(set: *mut sigset_t, signum: libc::c_int) -> libc::c_int;
}
#[cfg(target_os = "macos")]
+#[cfg(target_os = "ios")]
mod select {
pub static FD_SETSIZE: uint = 1024;
}
pub fn fd_set(set: &mut fd_set, fd: i32) {
- set.fds_bits[(fd / 32) as uint] |= 1 << (fd % 32);
+ set.fds_bits[(fd / 32) as uint] |= 1 << ((fd % 32) as uint);
}
}
#[cfg(target_os = "android")]
#[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
#[cfg(target_os = "linux")]
mod select {
use std::uint;
pub static FD_SETSIZE: uint = 1024;
pub struct fd_set {
+ // FIXME: shouldn't this be a c_ulong?
fds_bits: [uint, ..(FD_SETSIZE / uint::BITS)]
}
}
}
-#[cfg(target_os = "linux", not(target_arch = "mips"))]
+#[cfg(target_os = "linux", target_arch = "x86")]
+#[cfg(target_os = "linux", target_arch = "x86_64")]
+#[cfg(target_os = "linux", target_arch = "arm")]
#[cfg(target_os = "android")]
mod signal {
use libc;
}
#[cfg(target_os = "linux", target_arch = "mips")]
+#[cfg(target_os = "linux", target_arch = "mipsel")]
mod signal {
use libc;
}
#[cfg(target_os = "macos")]
+#[cfg(target_os = "ios")]
#[cfg(target_os = "freebsd")]
+#[cfg(target_os = "dragonfly")]
mod signal {
use libc;
pub static SIGCHLD: libc::c_int = 20;
#[cfg(target_os = "macos")]
+ #[cfg(target_os = "ios")]
pub type sigset_t = u32;
#[cfg(target_os = "freebsd")]
+ #[cfg(target_os = "dragonfly")]
pub struct sigset_t {
bits: [u32, ..4],
}
}
#[cfg(target_os = "macos")]
+ #[cfg(target_os = "ios")]
pub struct sigaction {
pub sa_handler: extern fn(libc::c_int),
sa_tramp: *mut libc::c_void,
}
#[cfg(target_os = "freebsd")]
+ #[cfg(target_os = "dragonfly")]
pub struct sigaction {
pub sa_handler: extern fn(libc::c_int),
pub sa_flags: libc::c_int,