Skip to content

Commit 157675a

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 115e7a7 commit 157675a

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.2 and 13 (r352486).
1814+
"CTL_UNSPEC" | "CTL_SYSCTL" => true,
1815+
1816+
// These were added in FreeBSD 12.2 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.2 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
@@ -442,7 +442,13 @@ pub const CLOCK_SECOND: ::clockid_t = 13;
442442
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
443443
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
444444

445+
#[doc(hidden)]
446+
#[deprecated(
447+
since = "0.2.72",
448+
note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
449+
)]
445450
pub const CTL_UNSPEC: ::c_int = 0;
451+
pub const CTL_SYSCTL: ::c_int = 0;
446452
pub const CTL_KERN: ::c_int = 1;
447453
pub const CTL_VM: ::c_int = 2;
448454
pub const CTL_VFS: ::c_int = 3;
@@ -452,6 +458,13 @@ pub const CTL_HW: ::c_int = 6;
452458
pub const CTL_MACHDEP: ::c_int = 7;
453459
pub const CTL_USER: ::c_int = 8;
454460
pub const CTL_P1003_1B: ::c_int = 9;
461+
pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
462+
pub const CTL_SYSCTL_NAME: ::c_int = 1;
463+
pub const CTL_SYSCTL_NEXT: ::c_int = 2;
464+
pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
465+
pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
466+
pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
467+
pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
455468
pub const KERN_OSTYPE: ::c_int = 1;
456469
pub const KERN_OSRELEASE: ::c_int = 2;
457470
pub const KERN_OSREV: ::c_int = 3;
@@ -769,8 +782,14 @@ pub const IPPROTO_BLT: ::c_int = 30;
769782
pub const IPPROTO_NSP: ::c_int = 31;
770783
/// Merit Internodal
771784
pub const IPPROTO_INP: ::c_int = 32;
772-
/// Sequential Exchange
785+
#[doc(hidden)]
786+
#[deprecated(
787+
since = "0.2.72",
788+
note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
789+
)]
773790
pub const IPPROTO_SEP: ::c_int = 33;
791+
/// Datagram Congestion Control Protocol
792+
pub const IPPROTO_DCCP: ::c_int = 33;
774793
/// Third Party Connect
775794
pub const IPPROTO_3PC: ::c_int = 34;
776795
/// InterDomain Policy Routing

0 commit comments

Comments
 (0)