summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Marie <semarie@users.noreply.github.com>2019-08-18 10:19:49 +0200
committerSébastien Marie <semarie@users.noreply.github.com>2019-08-18 10:19:49 +0200
commit3b7be3c193e56ca6e9eded2d20f24e919318ed12 (patch)
tree85bf7b619017534aef9d2c512b8cea1cb989287d
parentffbe923f92fb8a65b39a59f2f7dc2360d04ccafd (diff)
downloadrust-libc-3b7be3c193e56ca6e9eded2d20f24e919318ed12.tar.gz
adapt ioctl() BPF for OpenBSD
-rw-r--r--libc-test/build.rs1
-rw-r--r--src/unix/bsd/apple/mod.rs5
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs5
-rw-r--r--src/unix/bsd/mod.rs5
-rw-r--r--src/unix/bsd/netbsdlike/netbsd/mod.rs6
-rw-r--r--src/unix/bsd/netbsdlike/openbsd/mod.rs4
6 files changed, 21 insertions, 5 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index 146beb0734..002ece011b 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -264,6 +264,7 @@ fn test_openbsd(target: &str) {
"netinet/ip.h",
"netinet/tcp.h",
"netinet/udp.h",
+ "net/bpf.h",
"resolv.h",
"pthread.h",
"dlfcn.h",
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index e597729499..7230385c9e 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -1761,6 +1761,11 @@ pub const TIOCPTYGRANT: ::c_uint = 0x20007454;
pub const TIOCPTYGNAME: ::c_uint = 0x40807453;
pub const TIOCPTYUNLK: ::c_uint = 0x20007452;
+pub const BIOCGRSIG: ::c_ulong = 0x40044272;
+pub const BIOCSRSIG: ::c_ulong = 0x80044273;
+pub const BIOCSDLT: ::c_ulong = 0x80044278;
+pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
+pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
pub const BIOCGDLTLIST: ::c_ulong = 0xc00c4279;
pub const FIODTYPE: ::c_ulong = 0x4004667a;
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index aed3ac660d..2561e2504e 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -1009,6 +1009,11 @@ pub const SLIPDISC: ::c_int = 0x4;
pub const PPPDISC: ::c_int = 0x5;
pub const NETGRAPHDISC: ::c_int = 0x6;
+pub const BIOCGRSIG: ::c_ulong = 0x40044272;
+pub const BIOCSRSIG: ::c_ulong = 0x80044273;
+pub const BIOCSDLT: ::c_ulong = 0x80044278;
+pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
+pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
pub const BIOCSETF: ::c_ulong = 0x80104267;
pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279;
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 193cd7478e..40b18c638d 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -446,13 +446,8 @@ pub const BIOCSETIF: ::c_ulong = 0x8020426c;
pub const BIOCGSTATS: ::c_ulong = 0x4008426f;
pub const BIOCIMMEDIATE: ::c_ulong = 0x80044270;
pub const BIOCVERSION: ::c_ulong = 0x40044271;
-pub const BIOCGRSIG: ::c_ulong = 0x40044272;
-pub const BIOCSRSIG: ::c_ulong = 0x80044273;
pub const BIOCGHDRCMPLT: ::c_ulong = 0x40044274;
pub const BIOCSHDRCMPLT: ::c_ulong = 0x80044275;
-pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
-pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
-pub const BIOCSDLT: ::c_ulong = 0x80044278;
pub const SIOCGIFADDR: ::c_ulong = 0xc0206921;
f! {
diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs
index 893b15752a..dc5b092ce9 100644
--- a/src/unix/bsd/netbsdlike/netbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs
@@ -1077,6 +1077,12 @@ pub const FD_SETSIZE: usize = 0x100;
pub const ST_NOSUID: ::c_ulong = 8;
+pub const BIOCGRSIG: ::c_ulong = 0x40044272;
+pub const BIOCSRSIG: ::c_ulong = 0x80044273;
+pub const BIOCSDLT: ::c_ulong = 0x80044278;
+pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
+pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
+
cfg_if! {
if #[cfg(any(target_arch = "sparc", target_arch = "sparc64",
target_arch = "x86", target_arch = "x86_64"))] {
diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs
index 51b1bf14d7..f942ece375 100644
--- a/src/unix/bsd/netbsdlike/openbsd/mod.rs
+++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs
@@ -1307,6 +1307,10 @@ pub const SOCK_CLOEXEC: ::c_int = 0x8000;
pub const SOCK_NONBLOCK: ::c_int = 0x4000;
pub const SOCK_DNS: ::c_int = 0x1000;
+pub const BIOCGRSIG: ::c_ulong = 0x40044273;
+pub const BIOCSRSIG: ::c_ulong = 0x80044272;
+pub const BIOCSDLT: ::c_ulong = 0x8004427a;
+
pub const PTRACE_FORK: ::c_int = 0x0002;
pub const WCONTINUED: ::c_int = 8;