Skip to content

Separate OpenBSD and FreeBSD in fcntl.rs #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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;
Expand Down