summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cann <shum@canndrew.org>2018-05-31 14:21:46 +0800
committerAndrew Cann <shum@canndrew.org>2018-05-31 14:21:46 +0800
commit96c94839f197e9b7f0297df4d58bed383660d15f (patch)
treeaf566b9b9511de993313ba79027b3691e2c92c8a
parente4a50811dd73b582a0dda665d1866b08a0e438fb (diff)
downloadrust-libc-96c94839f197e9b7f0297df4d58bed383660d15f.tar.gz
make some symbols linux-specific
-rw-r--r--src/unix/notbsd/linux/mod.rs11
-rw-r--r--src/unix/notbsd/mod.rs11
2 files changed, 11 insertions, 11 deletions
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index 7cc059a389..a6ac3b5660 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -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 {
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 31a520d05b..2a6d616e57 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -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
}