summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/errno.rs2
-rw-r--r--src/fcntl.rs3
-rw-r--r--src/sys/event.rs7
-rw-r--r--src/sys/signal.rs3
4 files changed, 12 insertions, 3 deletions
diff --git a/src/errno.rs b/src/errno.rs
index 2b393dee..af962c39 100644
--- a/src/errno.rs
+++ b/src/errno.rs
@@ -562,7 +562,7 @@ mod consts {
#[cfg(any(target_os = "macos", target_os = "ios"))]
mod consts {
- #[deriving(Show, Clone, PartialEq, FromPrimitive)]
+ #[deriving(Copy, Show, Clone, PartialEq, FromPrimitive)]
pub enum Errno {
UnknownErrno = 0,
EPERM = 1,
diff --git a/src/fcntl.rs b/src/fcntl.rs
index ca6686f7..50c4ece8 100644
--- a/src/fcntl.rs
+++ b/src/fcntl.rs
@@ -46,6 +46,7 @@ mod ffi {
use libc::{c_int, c_short, off_t, pid_t};
#[repr(C)]
+ #[deriving(Copy)]
pub struct flock {
pub l_start: off_t,
pub l_len: off_t,
@@ -162,6 +163,7 @@ mod consts {
use libc::c_int;
bitflags!(
+ #[deriving(Copy)]
flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
@@ -184,6 +186,7 @@ mod consts {
)
bitflags!(
+ #[deriving(Copy)]
flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
diff --git a/src/sys/event.rs b/src/sys/event.rs
index b8370ef0..b1dfcc85 100644
--- a/src/sys/event.rs
+++ b/src/sys/event.rs
@@ -1,7 +1,7 @@
/* TOOD: Implement for other kqueue based systems
*/
-use libc::{timespec, time_t, c_int, c_long, c_short};
+use libc::{timespec, time_t, c_int, c_long};
use errno::{SysResult, SysError};
use fcntl::Fd;
use std::fmt;
@@ -12,6 +12,7 @@ mod ffi {
pub use libc::{c_int, c_void, uintptr_t, intptr_t, timespec};
use super::{EventFilter, EventFlag, FilterFlag};
+ #[deriving(Copy)]
#[repr(C)]
pub struct kevent {
pub ident: uintptr_t, // 8
@@ -38,7 +39,7 @@ mod ffi {
}
#[repr(i16)]
-#[deriving(Show, PartialEq)]
+#[deriving(Copy, Show, PartialEq)]
pub enum EventFilter {
EVFILT_READ = -1,
EVFILT_WRITE = -2,
@@ -56,6 +57,7 @@ pub enum EventFilter {
}
bitflags!(
+ #[deriving(Copy)]
flags EventFlag: u16 {
const EV_ADD = 0x0001,
const EV_DELETE = 0x0002,
@@ -108,6 +110,7 @@ impl fmt::Show for EventFlag {
}
bitflags!(
+ #[deriving(Copy)]
flags FilterFlag: u32 {
const NOTE_TRIGGER = 0x01000000,
const NOTE_FFNOP = 0x00000000,
diff --git a/src/sys/signal.rs b/src/sys/signal.rs
index 731eecd0..f3957b56 100644
--- a/src/sys/signal.rs
+++ b/src/sys/signal.rs
@@ -206,6 +206,7 @@ pub mod signal {
use libc;
bitflags!(
+ #[deriving(Copy)]
flags SockFlag: libc::c_int {
const SA_NOCLDSTOP = 0x0008,
const SA_NOCLDWAIT = 0x0020,
@@ -249,6 +250,7 @@ pub mod signal {
// This structure has more fields, but we're not all that interested in
// them.
#[repr(C)]
+ #[deriving(Copy)]
pub struct siginfo {
pub si_signo: libc::c_int,
pub si_errno: libc::c_int,
@@ -260,6 +262,7 @@ pub mod signal {
#[cfg(any(target_os = "macos", target_os = "ios"))]
#[repr(C)]
+ #[allow(missing_copy_implementations)]
pub struct sigaction {
pub sa_handler: extern fn(libc::c_int),
sa_tramp: *mut libc::c_void,