Skip to content

Commit

Permalink
Bump bitflags to 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Sep 30, 2016
1 parent 1b4656f commit 432ab3f
Show file tree
Hide file tree
Showing 21 changed files with 58 additions and 58 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ signalfd = []

[dependencies]
libc = { git = "https://github.com/rust-lang/libc" }
bitflags = "0.4"
bitflags = "0.7"
cfg-if = "0.1.0"
void = "1.0.2"

Expand Down
24 changes: 12 additions & 12 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ mod consts {
use libc::{self, c_int, c_uint};

bitflags! {
flags SpliceFFlags: c_uint {
pub flags SpliceFFlags: c_uint {
const SPLICE_F_MOVE = libc::SPLICE_F_MOVE,
const SPLICE_F_NONBLOCK = libc::SPLICE_F_NONBLOCK,
const SPLICE_F_MORE = libc::SPLICE_F_MORE,
Expand All @@ -147,7 +147,7 @@ mod consts {
}

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0o00000003,
const O_RDONLY = 0o00000000,
const O_WRONLY = 0o00000001,
Expand All @@ -173,13 +173,13 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);

bitflags!(
flags SealFlag: c_int {
pub flags SealFlag: c_int {
const F_SEAL_SEAL = 1,
const F_SEAL_SHRINK = 2,
const F_SEAL_GROW = 4,
Expand All @@ -194,7 +194,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand All @@ -216,7 +216,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand All @@ -227,7 +227,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand All @@ -253,7 +253,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand All @@ -264,7 +264,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand Down Expand Up @@ -294,7 +294,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand All @@ -305,7 +305,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand All @@ -329,7 +329,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand Down
2 changes: 1 addition & 1 deletion src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ macro_rules! libc_bitflags {
// (non-pub) Entry rule.
(
$(#[$attr:meta])*
flags $BitFlags:ident: $T:ty {
pub flags $BitFlags:ident: $T:ty {
$($vals:tt)*
}
) => {
Expand Down
4 changes: 2 additions & 2 deletions src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use libc;
use {Errno, Result, NixPath};

bitflags!(
flags MsFlags: c_ulong {
pub flags MsFlags: c_ulong {
const MS_RDONLY = 1 << 0, // Mount read-only
const MS_NOSUID = 1 << 1, // Ignore suid and sgid bits
const MS_NODEV = 1 << 2, // Disallow access to device special files
Expand Down Expand Up @@ -42,7 +42,7 @@ bitflags!(
);

bitflags!(
flags MntFlags: c_int {
pub flags MntFlags: c_int {
const MNT_FORCE = 1 << 0,
const MNT_DETACH = 1 << 1,
const MNT_EXPIRE = 1 << 2
Expand Down
4 changes: 2 additions & 2 deletions src/mqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sys::stat::Mode;
use std::mem;

libc_bitflags!{
flags MQ_OFlag: libc::c_int {
pub flags MQ_OFlag: libc::c_int {
O_RDONLY,
O_WRONLY,
O_RDWR,
Expand All @@ -22,7 +22,7 @@ libc_bitflags!{
}

libc_bitflags!{
flags FdFlag: libc::c_int {
pub flags FdFlag: libc::c_int {
FD_CLOEXEC,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl PollFd {
}

libc_bitflags! {
flags EventFlags: libc::c_short {
pub flags EventFlags: libc::c_short {
POLLIN,
POLLPRI,
POLLOUT,
Expand Down
2 changes: 1 addition & 1 deletion src/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use {Errno, Error, Result};
// For some functions taking with a parameter of type CloneFlags,
// only a subset of these flags have an effect.
libc_bitflags!{
flags CloneFlags: libc::c_int {
pub flags CloneFlags: libc::c_int {
CLONE_VM,
CLONE_FS,
CLONE_FILES,
Expand Down
4 changes: 2 additions & 2 deletions src/sys/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::os::unix::io::RawFd;

bitflags!(
#[repr(C)]
flags EpollFlags: u32 {
pub flags EpollFlags: u32 {
const EPOLLIN = 0x001,
const EPOLLPRI = 0x002,
const EPOLLOUT = 0x004,
Expand Down Expand Up @@ -32,7 +32,7 @@ pub enum EpollOp {
}

libc_bitflags!{
flags EpollCreateFlags: c_int {
pub flags EpollCreateFlags: c_int {
EPOLL_CLOEXEC,
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/sys/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub enum EventFilter {

#[cfg(not(any(target_os = "dragonfly", target_os = "netbsd")))]
bitflags!(
flags EventFlag: u16 {
pub flags EventFlag: u16 {
const EV_ADD = 0x0001,
const EV_DELETE = 0x0002,
const EV_ENABLE = 0x0004,
Expand All @@ -133,7 +133,7 @@ bitflags!(

#[cfg(target_os = "dragonfly")]
bitflags!(
flags EventFlag: u16 {
pub flags EventFlag: u16 {
const EV_ADD = 0x0001,
const EV_DELETE = 0x0002,
const EV_ENABLE = 0x0004,
Expand All @@ -151,7 +151,7 @@ bitflags!(

#[cfg(target_os = "netbsd")]
bitflags!(
flags EventFlag: u32 {
pub flags EventFlag: u32 {
const EV_ADD = 0x0001,
const EV_DELETE = 0x0002,
const EV_ENABLE = 0x0004,
Expand All @@ -168,7 +168,7 @@ bitflags!(

#[cfg(not(any(target_os = "dragonfly", target_os="netbsd")))]
bitflags!(
flags FilterFlag: u32 {
pub flags FilterFlag: u32 {
const NOTE_TRIGGER = 0x01000000,
const NOTE_FFNOP = 0x00000000,
const NOTE_FFAND = 0x40000000,
Expand Down Expand Up @@ -216,7 +216,7 @@ bitflags!(

#[cfg(target_os = "dragonfly")]
bitflags!(
flags FilterFlag: u32 {
pub flags FilterFlag: u32 {
const NOTE_TRIGGER = 0x01000000,
const NOTE_FFNOP = 0x00000000,
const NOTE_FFAND = 0x40000000,
Expand Down Expand Up @@ -246,7 +246,7 @@ bitflags!(

#[cfg(target_os = "netbsd")]
bitflags!(
flags FilterFlag: u32 {
pub flags FilterFlag: u32 {
const NOTE_LOWAT = 0x00000001,
const NOTE_DELETE = 0x00000001,
const NOTE_WRITE = 0x00000002,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/eventfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::os::unix::io::RawFd;
use {Errno, Result};

libc_bitflags! {
flags EfdFlags: libc::c_int {
pub flags EfdFlags: libc::c_int {
const EFD_CLOEXEC, // Since Linux 2.6.27
const EFD_NONBLOCK, // Since Linux 2.6.27
const EFD_SEMAPHORE, // Since Linux 2.6.30
Expand Down
2 changes: 1 addition & 1 deletion src/sys/memfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {Errno, Result};
use std::ffi::CStr;

bitflags!(
flags MemFdCreateFlag: libc::c_uint {
pub flags MemFdCreateFlag: libc::c_uint {
const MFD_CLOEXEC = 0x0001,
const MFD_ALLOW_SEALING = 0x0002,
}
Expand Down
14 changes: 7 additions & 7 deletions src/sys/mman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::os::unix::io::RawFd;
pub use self::consts::*;

libc_bitflags!{
flags ProtFlags: libc::c_int {
pub flags ProtFlags: libc::c_int {
PROT_NONE,
PROT_READ,
PROT_WRITE,
Expand All @@ -24,7 +24,7 @@ mod consts {
use libc::{self, c_int};

bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
Expand Down Expand Up @@ -65,7 +65,7 @@ mod consts {


bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC,
const MS_INVALIDATE = libc::MS_INVALIDATE,
const MS_SYNC = libc::MS_SYNC,
Expand All @@ -81,7 +81,7 @@ mod consts {
use libc::{self, c_int};

bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
Expand All @@ -106,7 +106,7 @@ mod consts {
pub const MADV_CAN_REUSE : MmapAdvise = 9;

bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC, /* [MF|SIO] return immediately */
const MS_INVALIDATE = libc::MS_INVALIDATE, /* [MF|SIO] invalidate all cached data */
const MS_KILLPAGES = libc::MS_KILLPAGES, /* invalidate pages, leave mapped */
Expand All @@ -123,7 +123,7 @@ mod consts {
use libc::{self, c_int};

bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
Expand Down Expand Up @@ -161,7 +161,7 @@ mod consts {
pub const MADV_SETMAP : MmapAdvise = 11; /* set page table directory page for map */

bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC, /* [MF|SIO] return immediately */
const MS_INVALIDATE = libc::MS_INVALIDATE, /* [MF|SIO] invalidate all cached data */
#[cfg(not(target_os = "dragonfly"))]
Expand Down
2 changes: 1 addition & 1 deletion src/sys/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub mod quota {

bitflags!(
#[derive(Default)]
flags QuotaValidFlags: u32 {
pub flags QuotaValidFlags: u32 {
const QIF_BLIMITS = 1,
const QIF_SPACE = 2,
const QIF_ILIMITS = 4,
Expand Down
4 changes: 2 additions & 2 deletions src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub const SIGPOLL : Signal = SIGIO;
pub const SIGUNUSED : Signal = SIGSYS;

bitflags!{
flags SaFlags: libc::c_int {
pub flags SaFlags: libc::c_int {
const SA_NOCLDSTOP = libc::SA_NOCLDSTOP,
const SA_NOCLDWAIT = libc::SA_NOCLDWAIT,
const SA_NODEFER = libc::SA_NODEFER,
Expand All @@ -207,7 +207,7 @@ bitflags!{
}

bitflags!{
flags SigFlags: libc::c_int {
pub flags SigFlags: libc::c_int {
const SIG_BLOCK = libc::SIG_BLOCK,
const SIG_UNBLOCK = libc::SIG_UNBLOCK,
const SIG_SETMASK = libc::SIG_SETMASK,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/signalfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::mem;


bitflags!{
flags SfdFlags: libc::c_int {
pub flags SfdFlags: libc::c_int {
const SFD_NONBLOCK = libc::SFD_NONBLOCK,
const SFD_CLOEXEC = libc::SFD_CLOEXEC,
}
Expand Down
6 changes: 3 additions & 3 deletions src/sys/socket/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod os {

// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags : libc::c_int {
const MSG_OOB = 0x0001,
const MSG_PEEK = 0x0002,
const MSG_CTRUNC = 0x0008,
Expand Down Expand Up @@ -225,7 +225,7 @@ mod os {

// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags : libc::c_int {
const MSG_OOB = 0x01,
const MSG_PEEK = 0x02,
const MSG_EOR = 0x08,
Expand Down Expand Up @@ -311,7 +311,7 @@ mod os {

// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags : libc::c_int {
const MSG_OOB = 0x01,
const MSG_PEEK = 0x02,
const MSG_DONTWAIT = 0x80,
Expand Down
Loading

0 comments on commit 432ab3f

Please sign in to comment.