Skip to content

Commit ba7b810

Browse files
committed
NetBSD: Remove BPF constants
These are currently incorrect, so remove them for now. If desired, they can be added back in the future using the `_IO*` functions. (backport <#4782>) (cherry picked from commit 7de84bf)
1 parent 213f4b0 commit ba7b810

File tree

3 files changed

+18
-37
lines changed

3 files changed

+18
-37
lines changed

libc-test/semver/netbsd.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -103,23 +103,6 @@ B460800
103103
B7200
104104
B76800
105105
B921600
106-
BIOCFLUSH
107-
BIOCGBLEN
108-
BIOCGDLT
109-
BIOCGETIF
110-
BIOCGHDRCMPLT
111-
BIOCGRSIG
112-
BIOCGSEESENT
113-
BIOCGSTATS
114-
BIOCIMMEDIATE
115-
BIOCPROMISC
116-
BIOCSBLEN
117-
BIOCSDLT
118-
BIOCSETIF
119-
BIOCSHDRCMPLT
120-
BIOCSRSIG
121-
BIOCSSEESENT
122-
BIOCVERSION
123106
BOOT_TIME
124107
BUFSIZ
125108
BUS_ADRALN
@@ -990,7 +973,6 @@ SIGINFO
990973
SIGIO
991974
SIGNATURE
992975
SIGSTKSZ
993-
SIOCGIFADDR
994976
SOCKCREDSIZE
995977
SOCK_CLOEXEC
996978
SOCK_CONN_DGRAM

src/unix/bsd/mod.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -398,19 +398,24 @@ pub const POLLWRNORM: c_short = 0x004;
398398
pub const POLLRDBAND: c_short = 0x080;
399399
pub const POLLWRBAND: c_short = 0x100;
400400

401-
pub const BIOCGBLEN: c_ulong = 0x40044266;
402-
pub const BIOCSBLEN: c_ulong = 0xc0044266;
403-
pub const BIOCFLUSH: c_uint = 0x20004268;
404-
pub const BIOCPROMISC: c_uint = 0x20004269;
405-
pub const BIOCGDLT: c_ulong = 0x4004426a;
406-
pub const BIOCGETIF: c_ulong = 0x4020426b;
407-
pub const BIOCSETIF: c_ulong = 0x8020426c;
408-
pub const BIOCGSTATS: c_ulong = 0x4008426f;
409-
pub const BIOCIMMEDIATE: c_ulong = 0x80044270;
410-
pub const BIOCVERSION: c_ulong = 0x40044271;
411-
pub const BIOCGHDRCMPLT: c_ulong = 0x40044274;
412-
pub const BIOCSHDRCMPLT: c_ulong = 0x80044275;
413-
pub const SIOCGIFADDR: c_ulong = 0xc0206921;
401+
cfg_if! {
402+
// Not yet implemented on NetBSD
403+
if #[cfg(not(any(target_os = "netbsd")))] {
404+
pub const BIOCGBLEN: c_ulong = 0x40044266;
405+
pub const BIOCSBLEN: c_ulong = 0xc0044266;
406+
pub const BIOCFLUSH: c_uint = 0x20004268;
407+
pub const BIOCPROMISC: c_uint = 0x20004269;
408+
pub const BIOCGDLT: c_ulong = 0x4004426a;
409+
pub const BIOCGETIF: c_ulong = 0x4020426b;
410+
pub const BIOCSETIF: c_ulong = 0x8020426c;
411+
pub const BIOCGSTATS: c_ulong = 0x4008426f;
412+
pub const BIOCIMMEDIATE: c_ulong = 0x80044270;
413+
pub const BIOCVERSION: c_ulong = 0x40044271;
414+
pub const BIOCGHDRCMPLT: c_ulong = 0x40044274;
415+
pub const BIOCSHDRCMPLT: c_ulong = 0x80044275;
416+
pub const SIOCGIFADDR: c_ulong = 0xc0206921;
417+
}
418+
}
414419

415420
pub const REG_BASIC: c_int = 0o0000;
416421
pub const REG_EXTENDED: c_int = 0o0001;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1403,12 +1403,6 @@ pub const FD_SETSIZE: usize = 0x100;
14031403

14041404
pub const ST_NOSUID: c_ulong = 8;
14051405

1406-
pub const BIOCGRSIG: c_ulong = 0x40044272;
1407-
pub const BIOCSRSIG: c_ulong = 0x80044273;
1408-
pub const BIOCSDLT: c_ulong = 0x80044278;
1409-
pub const BIOCGSEESENT: c_ulong = 0x40044276;
1410-
pub const BIOCSSEESENT: c_ulong = 0x80044277;
1411-
14121406
// <sys/fstypes.h>
14131407
pub const MNT_UNION: c_int = 0x00000020;
14141408
pub const MNT_NOCOREDUMP: c_int = 0x00008000;

0 commit comments

Comments
 (0)