Skip to content

Commit 6dc32e3

Browse files
committed
FreeBSD: chase CTL_UNSPEC to CTL_SYSCTL, IPPROTO_SEP to IPPROTO_DCCP renames
Plus, add new constants for sysctls that give names to existing magic numbers. https://reviews.freebsd.org/rS350749 https://reviews.freebsd.org/rS352486
1 parent 4b318e8 commit 6dc32e3

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

libc-test/build.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,6 +1810,22 @@ fn test_freebsd(target: &str) {
18101810
// base system anyway.
18111811
"CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "USER_MAXID" => true,
18121812

1813+
// This was renamed in FreeBSD 12 and 13 (r352486).
1814+
"CTL_UNSPEC" | "CTL_SYSCTL" => true,
1815+
1816+
// These were added in FreeBSD 12 and 13 (r352486),
1817+
// but they are just names for magic numbers that existed for ages.
1818+
"CTL_SYSCTL_DEBUG"
1819+
| "CTL_SYSCTL_NAME"
1820+
| "CTL_SYSCTL_NEXT"
1821+
| "CTL_SYSCTL_NAME2OID"
1822+
| "CTL_SYSCTL_OIDFMT"
1823+
| "CTL_SYSCTL_OIDDESCR"
1824+
| "CTL_SYSCTL_OIDLABEL" => true,
1825+
1826+
// This was renamed in FreeBSD 12 and 13 (r350749).
1827+
"IPPROTO_SEP" | "IPPROTO_DCCP" => true,
1828+
18131829
_ => false,
18141830
}
18151831
});

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,13 @@ pub const CLOCK_SECOND: ::clockid_t = 13;
455455
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
456456
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
457457

458+
#[doc(hidden)]
459+
#[deprecated(
460+
since = "0.2.72",
461+
note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
462+
)]
458463
pub const CTL_UNSPEC: ::c_int = 0;
464+
pub const CTL_SYSCTL: ::c_int = 0;
459465
pub const CTL_KERN: ::c_int = 1;
460466
pub const CTL_VM: ::c_int = 2;
461467
pub const CTL_VFS: ::c_int = 3;
@@ -465,6 +471,13 @@ pub const CTL_HW: ::c_int = 6;
465471
pub const CTL_MACHDEP: ::c_int = 7;
466472
pub const CTL_USER: ::c_int = 8;
467473
pub const CTL_P1003_1B: ::c_int = 9;
474+
pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
475+
pub const CTL_SYSCTL_NAME: ::c_int = 1;
476+
pub const CTL_SYSCTL_NEXT: ::c_int = 2;
477+
pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
478+
pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
479+
pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
480+
pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
468481
pub const KERN_OSTYPE: ::c_int = 1;
469482
pub const KERN_OSRELEASE: ::c_int = 2;
470483
pub const KERN_OSREV: ::c_int = 3;
@@ -782,8 +795,14 @@ pub const IPPROTO_BLT: ::c_int = 30;
782795
pub const IPPROTO_NSP: ::c_int = 31;
783796
/// Merit Internodal
784797
pub const IPPROTO_INP: ::c_int = 32;
785-
/// Sequential Exchange
798+
#[doc(hidden)]
799+
#[deprecated(
800+
since = "0.2.72",
801+
note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
802+
)]
786803
pub const IPPROTO_SEP: ::c_int = 33;
804+
/// Datagram Congestion Control Protocol
805+
pub const IPPROTO_DCCP: ::c_int = 33;
787806
/// Third Party Connect
788807
pub const IPPROTO_3PC: ::c_int = 34;
789808
/// InterDomain Policy Routing

0 commit comments

Comments
 (0)