summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorequal-l2 <eng.equall2@gmail.com>2017-06-19 13:20:41 +0900
committerequal-l2 <eng.equall2@gmail.com>2017-06-19 16:32:20 +0900
commitc77d50573eb6ce318e6da649b892093e30d190c4 (patch)
tree8c3f690e63833143e986d56c4ba0fe7e1f5b644a
parentab5435e8bc9b10ed3dc05787c10d28bb8957a42a (diff)
downloadnix-c77d50573eb6ce318e6da649b892093e30d190c4.zip
Separate OpenBSD and FreeBSD in fcntl.rs
-rw-r--r--src/fcntl.rs36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/fcntl.rs b/src/fcntl.rs
index a295de3a..5d37e500 100644
--- a/src/fcntl.rs
+++ b/src/fcntl.rs
@@ -288,7 +288,7 @@ mod consts {
);
}
-#[cfg(any(target_os = "freebsd", target_os = "openbsd"))]
+#[cfg(target_os = "freebsd")]
mod consts {
use libc::{self, c_int};
@@ -325,6 +325,40 @@ mod consts {
);
}
+#[cfg(target_os = "openbsd")]
+mod consts {
+ use libc::{self, c_int};
+
+ bitflags!(
+ pub flags OFlag: c_int {
+ const O_ACCMODE = libc::O_ACCMODE,
+ const O_RDONLY = libc::O_RDONLY,
+ const O_WRONLY = libc::O_WRONLY,
+ const O_RDWR = libc::O_RDWR,
+ const O_CREAT = libc::O_CREAT,
+ const O_EXCL = libc::O_EXCL,
+ const O_NOCTTY = libc::O_NOCTTY,
+ const O_TRUNC = libc::O_TRUNC,
+ const O_APPEND = libc::O_APPEND,
+ const O_NONBLOCK = libc::O_NONBLOCK,
+ const O_DIRECTORY = 0x0020000,
+ const O_NOFOLLOW = libc::O_NOFOLLOW,
+ const O_CLOEXEC = libc::O_CLOEXEC,
+ const O_SYNC = libc::O_SYNC,
+ const O_NDELAY = libc::O_NDELAY,
+ const O_FSYNC = libc::O_FSYNC,
+ const O_SHLOCK = 0x0000080,
+ const O_EXLOCK = 0x0000020,
+ }
+ );
+
+ bitflags!(
+ pub flags FdFlag: c_int {
+ const FD_CLOEXEC = 1
+ }
+ );
+}
+
#[cfg(target_os = "netbsd")]
mod consts {
use libc::c_int;