Skip to content

Commit ab57796

Browse files
committed
Fix the tests on the latest FreeBSD 14.0-CURRENT
1 parent b6e4704 commit ab57796

File tree

3 files changed

+76
-4
lines changed

3 files changed

+76
-4
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ task:
2929
task:
3030
name: nightly x86_64-unknown-freebsd-14
3131
freebsd_instance:
32-
image: freebsd-14-0-current-amd64-v20220203
32+
image: freebsd-14-0-current-amd64-v20220902
3333
setup_script:
3434
- pkg install -y curl
3535
- curl https://sh.rustup.rs -sSf --output rustup.sh

libc-test/build.rs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2009,17 +2009,39 @@ fn test_freebsd(target: &str) {
20092009
// These constants were introduced in FreeBSD 13:
20102010
"EFD_CLOEXEC" | "EFD_NONBLOCK" | "EFD_SEMAPHORE" if Some(13) > freebsd_ver => true,
20112011

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

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

2023+
// FIXME: This is deprecated - remove in a couple of releases.
2024+
// This was removed in FreeBSD 14 (git 1b4701fe1e8) and never
2025+
// should've been used anywhere anyway.
2026+
"TDF_UNUSED23" => true,
2027+
2028+
// FIXME: These are deprecated - remove in a couple of releases.
2029+
// These symbols are not stable across OS-versions. They were
2030+
// changed for FreeBSD 14 in git revisions b62848b0c3f and
2031+
// 2cf7870864e.
2032+
"PRI_MAX_ITHD" | "PRI_MIN_REALTIME" | "PRI_MAX_REALTIME" | "PRI_MIN_KERN"
2033+
| "PRI_MAX_KERN" | "PSWP" | "PVM" | "PINOD" | "PRIBIO" | "PVFS" | "PZERO" | "PSOCK"
2034+
| "PWAIT" | "PLOCK" | "PPAUSE" | "PRI_MIN_TIMESHARE" | "PUSER" | "PI_AV" | "PI_NET"
2035+
| "PI_DISK" | "PI_TTY" | "PI_DULL" | "PI_SOFT" => true,
2036+
2037+
// This symbol changed in FreeBSD 14 (git 051e7d78b03), but the new
2038+
// version should be safe to use on older releases.
2039+
"IFCAP_CANTCHANGE" => true,
2040+
2041+
// These were removed in FreeBSD 14 (git c6d31b8306e)
2042+
"TDF_ASTPENDING" | "TDF_NEEDSUSPCHK" | "TDF_NEEDRESCHED" | "TDF_NEEDSIGCHK"
2043+
| "TDF_ALRMPEND" | "TDF_PROFPEND" | "TDF_MACPEND" => true,
2044+
20232045
// This constant was removed in FreeBSD 13 (svn r363622), and never
20242046
// had any legitimate use outside of the base system anyway.
20252047
"CTL_P1003_1B_MAXID" => true,
@@ -2154,6 +2176,9 @@ fn test_freebsd(target: &str) {
21542176
// Added in FreeBSD 13
21552177
"FIOSSHMLPGCNF" if Some(13) > freebsd_ver => true,
21562178

2179+
// Added in FreeBSD 14
2180+
"IFCAP_NV" if Some(14) > freebsd_ver => true,
2181+
21572182
_ => false,
21582183
}
21592184
});

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2520,6 +2520,8 @@ pub const IFCAP_TOE4: ::c_int = 0x04000;
25202520
pub const IFCAP_TOE6: ::c_int = 0x08000;
25212521
/// interface hw can filter vlan tag
25222522
pub const IFCAP_VLAN_HWFILTER: ::c_int = 0x10000;
2523+
/// can do SIOCGIFCAPNV/SIOCSIFCAPNV
2524+
pub const IFCAP_NV: ::c_int = 0x20000;
25232525
/// can do IFCAP_TSO on VLANs
25242526
pub const IFCAP_VLAN_HWTSO: ::c_int = 0x40000;
25252527
/// the runtime link state is dynamic
@@ -2555,7 +2557,7 @@ pub const IFCAP_TSO: ::c_int = IFCAP_TSO4 | IFCAP_TSO6;
25552557
pub const IFCAP_WOL: ::c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC;
25562558
pub const IFCAP_TOE: ::c_int = IFCAP_TOE4 | IFCAP_TOE6;
25572559
pub const IFCAP_TXTLS: ::c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6;
2558-
pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP;
2560+
pub const IFCAP_CANTCHANGE: ::c_int = IFCAP_NETMAP | IFCAP_NV;
25592561

25602562
pub const IFQ_MAXLEN: ::c_int = 50;
25612563
pub const IFNET_SLOWHZ: ::c_int = 1;
@@ -3239,30 +3241,67 @@ pub const KKST_STATE_RUNNING: ::c_int = 2;
32393241
pub const PRI_MIN: ::c_int = 0;
32403242
pub const PRI_MAX: ::c_int = 255;
32413243
pub const PRI_MIN_ITHD: ::c_int = PRI_MIN;
3244+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3245+
#[allow(deprecated)]
32423246
pub const PRI_MAX_ITHD: ::c_int = PRI_MIN_REALTIME - 1;
32433247
pub const PI_REALTIME: ::c_int = PRI_MIN_ITHD + 0;
3248+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32443249
pub const PI_AV: ::c_int = PRI_MIN_ITHD + 4;
3250+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32453251
pub const PI_NET: ::c_int = PRI_MIN_ITHD + 8;
3252+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32463253
pub const PI_DISK: ::c_int = PRI_MIN_ITHD + 12;
3254+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32473255
pub const PI_TTY: ::c_int = PRI_MIN_ITHD + 16;
3256+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32483257
pub const PI_DULL: ::c_int = PRI_MIN_ITHD + 20;
3258+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32493259
pub const PI_SOFT: ::c_int = PRI_MIN_ITHD + 24;
3260+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32503261
pub const PRI_MIN_REALTIME: ::c_int = 48;
3262+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3263+
#[allow(deprecated)]
32513264
pub const PRI_MAX_REALTIME: ::c_int = PRI_MIN_KERN - 1;
3265+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32523266
pub const PRI_MIN_KERN: ::c_int = 80;
3267+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3268+
#[allow(deprecated)]
32533269
pub const PRI_MAX_KERN: ::c_int = PRI_MIN_TIMESHARE - 1;
3270+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3271+
#[allow(deprecated)]
32543272
pub const PSWP: ::c_int = PRI_MIN_KERN + 0;
3273+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3274+
#[allow(deprecated)]
32553275
pub const PVM: ::c_int = PRI_MIN_KERN + 4;
3276+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3277+
#[allow(deprecated)]
32563278
pub const PINOD: ::c_int = PRI_MIN_KERN + 8;
3279+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3280+
#[allow(deprecated)]
32573281
pub const PRIBIO: ::c_int = PRI_MIN_KERN + 12;
3282+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3283+
#[allow(deprecated)]
32583284
pub const PVFS: ::c_int = PRI_MIN_KERN + 16;
3285+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3286+
#[allow(deprecated)]
32593287
pub const PZERO: ::c_int = PRI_MIN_KERN + 20;
3288+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3289+
#[allow(deprecated)]
32603290
pub const PSOCK: ::c_int = PRI_MIN_KERN + 24;
3291+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3292+
#[allow(deprecated)]
32613293
pub const PWAIT: ::c_int = PRI_MIN_KERN + 28;
3294+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3295+
#[allow(deprecated)]
32623296
pub const PLOCK: ::c_int = PRI_MIN_KERN + 32;
3297+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3298+
#[allow(deprecated)]
32633299
pub const PPAUSE: ::c_int = PRI_MIN_KERN + 36;
3300+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
32643301
pub const PRI_MIN_TIMESHARE: ::c_int = 120;
32653302
pub const PRI_MAX_TIMESHARE: ::c_int = PRI_MIN_IDLE - 1;
3303+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
3304+
#[allow(deprecated)]
32663305
pub const PUSER: ::c_int = PRI_MIN_TIMESHARE;
32673306
pub const PRI_MIN_IDLE: ::c_int = 224;
32683307
pub const PRI_MAX_IDLE: ::c_int = PRI_MAX;
@@ -3360,24 +3399,32 @@ pub const TDF_CANSWAP: ::c_int = 0x00000040;
33603399
pub const TDF_KTH_SUSP: ::c_int = 0x00000100;
33613400
pub const TDF_ALLPROCSUSP: ::c_int = 0x00000200;
33623401
pub const TDF_BOUNDARY: ::c_int = 0x00000400;
3402+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33633403
pub const TDF_ASTPENDING: ::c_int = 0x00000800;
33643404
pub const TDF_SBDRY: ::c_int = 0x00002000;
33653405
pub const TDF_UPIBLOCKED: ::c_int = 0x00004000;
3406+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33663407
pub const TDF_NEEDSUSPCHK: ::c_int = 0x00008000;
3408+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33673409
pub const TDF_NEEDRESCHED: ::c_int = 0x00010000;
3410+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33683411
pub const TDF_NEEDSIGCHK: ::c_int = 0x00020000;
33693412
pub const TDF_NOLOAD: ::c_int = 0x00040000;
33703413
pub const TDF_SERESTART: ::c_int = 0x00080000;
33713414
pub const TDF_THRWAKEUP: ::c_int = 0x00100000;
33723415
pub const TDF_SEINTR: ::c_int = 0x00200000;
33733416
pub const TDF_SWAPINREQ: ::c_int = 0x00400000;
3417+
#[deprecated(since = "0.2.133", note = "Removed in FreeBSD 14")]
33743418
pub const TDF_UNUSED23: ::c_int = 0x00800000;
33753419
pub const TDF_SCHED0: ::c_int = 0x01000000;
33763420
pub const TDF_SCHED1: ::c_int = 0x02000000;
33773421
pub const TDF_SCHED2: ::c_int = 0x04000000;
33783422
pub const TDF_SCHED3: ::c_int = 0x08000000;
3423+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33793424
pub const TDF_ALRMPEND: ::c_int = 0x10000000;
3425+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33803426
pub const TDF_PROFPEND: ::c_int = 0x20000000;
3427+
#[deprecated(since = "0.2.133", note = "Not stable across OS versions")]
33813428
pub const TDF_MACPEND: ::c_int = 0x40000000;
33823429

33833430
pub const TDB_SUSPEND: ::c_int = 0x00000001;

0 commit comments

Comments
 (0)