Skip to content

Commit

Permalink
Fix the tests on the latest FreeBSD 14.0-CURRENT
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Sep 3, 2022
1 parent b6e4704 commit 35a8c7b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Expand Up @@ -29,7 +29,7 @@ task:
task:
name: nightly x86_64-unknown-freebsd-14
freebsd_instance:
image: freebsd-14-0-current-amd64-v20220203
image: freebsd-14-0-current-amd64-v20220902
setup_script:
- pkg install -y curl
- curl https://sh.rustup.rs -sSf --output rustup.sh
Expand Down
23 changes: 21 additions & 2 deletions libc-test/build.rs
Expand Up @@ -2009,17 +2009,36 @@ fn test_freebsd(target: &str) {
// These constants were introduced in FreeBSD 13:
"EFD_CLOEXEC" | "EFD_NONBLOCK" | "EFD_SEMAPHORE" if Some(13) > freebsd_ver => true,

// FIXME: There are deprecated - remove in a couple of releases.
// FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r273250) but will
// still be accepted and ignored at runtime.
"MAP_RENAME" | "MAP_NORESERVE" => true,

// FIXME: There are deprecated - remove in a couple of releases.
// FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r262489),
// and they've never had any legitimate use outside of the
// base system anyway.
"CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "USER_MAXID" => true,

// FIXME: This is deprecated - remove in a couple of releases.
// This was removed in FreeBSD 14 (git 1b4701fe1e8) and never
// should've been used anywhere anyway.
"TDF_UNUSED23" => true,

// FIXME: These are deprecated - remove in a couple of releases.
// These symbols are not stable across OS-versions. They were
// changed for FreeBSD 14 in git revisions b62848b0c3f and
// 2cf7870864e.
"PRI_MAX_ITHD" | "PRI_MIN_REALTIME" | "PRI_MAX_REALTIME" |
"PRI_MIN_KERN" | "PRI_MAX_KERN" | "PSWP" | "PVM" | "PINOD" |
"PRIBIO" | "PVFS" | "PZERO" | "PSOCK" | "PWAIT" | "PLOCK" |
"PPAUSE" | "PRI_MIN_TIMESHARE" | "PUSER" | "PI_AV" | "PI_NET" |
"PI_DISK" | "PI_TTY" | "PI_DULL" | "PI_SOFT" => true,

// This symbol changed in FreeBSD 14 (git 051e7d78b03), but the new
// version should be safe to use on older releases.
"IFCAP_CANTCHANGE" => true,

// This constant was removed in FreeBSD 13 (svn r363622), and never
// had any legitimate use outside of the base system anyway.
"CTL_P1003_1B_MAXID" => true,
Expand Down
43 changes: 42 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -2520,6 +2520,8 @@ pub const IFCAP_TOE4: ::c_int = 0x04000;
pub const IFCAP_TOE6: ::c_int = 0x08000;
/// interface hw can filter vlan tag
pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000;
/// can do SIOCGIFCAPNV/SIOCSIFCAPNV
pub const IFCAP_NV: ::c_int = 0x20000;
/// can do IFCAP_TSO on VLANs
pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000;
/// the runtime link state is dynamic
Expand Down Expand Up @@ -2555,7 +2557,7 @@ pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6;
pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC;
pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6;
pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6;
pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP;
pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP | IFCAP_NV;

pub const IFQ_MAXLEN: ::c_int = 50;
pub const IFNET_SLOWHZ: ::c_int = 1;
Expand Down Expand Up @@ -3239,30 +3241,67 @@ pub const KKST_STATE_RUNNING: ::c_int = 2;
pub const PRI_MIN: ::c_int = 0;
pub const PRI_MAX: ::c_int = 255;
pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PRI_MIN_REALTIME: ::c_int = 48;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PRI_MIN_KERN: ::c_int = 80;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PVM: ::c_int = PRI_MIN_KERN + 4;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
pub const PRI_MIN_TIMESHARE: ::c_int = 120;
pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
#[allow(deprecated)]
pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
pub const PRI_MIN_IDLE: ::c_int = 224;
pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
Expand Down Expand Up @@ -3371,7 +3410,9 @@ pub const TDF_SERESTART: ::c_int = 0x00080000;
pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
pub const TDF_SEINTR: ::c_int = 0x00200000;
pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
#[deprecated(since = "0.2.133", note = "Removed in FreeBSD 14")]
pub const TDF_UNUSED23: ::c_int = 0x00800000;
pub const TDF_DOING_SA: ::c_int = 0x00800000;
pub const TDF_SCHED0: ::c_int = 0x01000000;
pub const TDF_SCHED1: ::c_int = 0x02000000;
pub const TDF_SCHED2: ::c_int = 0x04000000;
Expand Down

0 comments on commit 35a8c7b

Please sign in to comment.