make some symbols linux-specific

This commit is contained in:
Andrew Cann 2018-05-31 14:21:46 +08:00
parent e4a50811dd
commit 96c94839f1
2 changed files with 11 additions and 11 deletions

View file

@ -1407,6 +1407,9 @@ pub const SIOCSRARP: ::c_ulong = 0x00008962;
pub const SIOCGIFMAP: ::c_ulong = 0x00008970;
pub const SIOCSIFMAP: ::c_ulong = 0x00008971;
pub const IPTOS_TOS_MASK: u8 = 0x1E;
pub const IPTOS_PREC_MASK: u8 = 0xE0;
f! {
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
for slot in cpuset.bits.iter_mut() {
@ -1462,6 +1465,14 @@ f! {
dev |= (minor & 0xffffff00) << 12;
dev
}
pub fn IPTOS_TOS(tos: u8) -> u8 {
tos & IPTOS_TOS_MASK
}
pub fn IPTOS_PREC(tos: u8) -> u8 {
tos & IPTOS_PREC_MASK
}
}
extern {

View file

@ -824,14 +824,11 @@ pub const POLLNVAL: ::c_short = 0x20;
pub const POLLRDNORM: ::c_short = 0x040;
pub const POLLRDBAND: ::c_short = 0x080;
pub const IPTOS_TOS_MASK: u8 = 0x1E;
pub const IPTOS_LOWDELAY: u8 = 0x10;
pub const IPTOS_THROUGHPUT: u8 = 0x08;
pub const IPTOS_RELIABILITY: u8 = 0x04;
pub const IPTOS_MINCOST: u8 = 0x02;
pub const IPTOS_PREC_MASK: u8 = 0xE0;
pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0;
pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0;
pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0;
@ -936,14 +933,6 @@ f! {
(cmd << 8) | (type_ & 0x00ff)
}
pub fn IPTOS_TOS(tos: u8) -> u8 {
tos & IPTOS_TOS_MASK
}
pub fn IPTOS_PREC(tos: u8) -> u8 {
tos & IPTOS_PREC_MASK
}
pub fn IPOPT_COPIED(o: u8) -> u8 {
o & IPOPT_COPY
}