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
This commit is contained in:
Greg V 2020-07-01 15:08:57 +03:00
parent 1e66be9c45
commit 9fc2574548
2 changed files with 36 additions and 1 deletions

View File

@ -1810,6 +1810,22 @@ fn test_freebsd(target: &str) {
// base system anyway.
"CTL_MAXID" | "KERN_MAXID" | "HW_MAXID" | "USER_MAXID" => true,
// This was renamed in FreeBSD 12.2 and 13 (r352486).
"CTL_UNSPEC" | "CTL_SYSCTL" => true,
// These were added in FreeBSD 12.2 and 13 (r352486),
// but they are just names for magic numbers that existed for ages.
"CTL_SYSCTL_DEBUG"
| "CTL_SYSCTL_NAME"
| "CTL_SYSCTL_NEXT"
| "CTL_SYSCTL_NAME2OID"
| "CTL_SYSCTL_OIDFMT"
| "CTL_SYSCTL_OIDDESCR"
| "CTL_SYSCTL_OIDLABEL" => true,
// This was renamed in FreeBSD 12.2 and 13 (r350749).
"IPPROTO_SEP" | "IPPROTO_DCCP" => true,
_ => false,
}
});

View File

@ -442,7 +442,13 @@ pub const CLOCK_SECOND: ::clockid_t = 13;
pub const CLOCK_THREAD_CPUTIME_ID: ::clockid_t = 14;
pub const CLOCK_PROCESS_CPUTIME_ID: ::clockid_t = 15;
#[doc(hidden)]
#[deprecated(
since = "0.2.72",
note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead"
)]
pub const CTL_UNSPEC: ::c_int = 0;
pub const CTL_SYSCTL: ::c_int = 0;
pub const CTL_KERN: ::c_int = 1;
pub const CTL_VM: ::c_int = 2;
pub const CTL_VFS: ::c_int = 3;
@ -452,6 +458,13 @@ pub const CTL_HW: ::c_int = 6;
pub const CTL_MACHDEP: ::c_int = 7;
pub const CTL_USER: ::c_int = 8;
pub const CTL_P1003_1B: ::c_int = 9;
pub const CTL_SYSCTL_DEBUG: ::c_int = 0;
pub const CTL_SYSCTL_NAME: ::c_int = 1;
pub const CTL_SYSCTL_NEXT: ::c_int = 2;
pub const CTL_SYSCTL_NAME2OID: ::c_int = 3;
pub const CTL_SYSCTL_OIDFMT: ::c_int = 4;
pub const CTL_SYSCTL_OIDDESCR: ::c_int = 5;
pub const CTL_SYSCTL_OIDLABEL: ::c_int = 6;
pub const KERN_OSTYPE: ::c_int = 1;
pub const KERN_OSRELEASE: ::c_int = 2;
pub const KERN_OSREV: ::c_int = 3;
@ -769,8 +782,14 @@ pub const IPPROTO_BLT: ::c_int = 30;
pub const IPPROTO_NSP: ::c_int = 31;
/// Merit Internodal
pub const IPPROTO_INP: ::c_int = 32;
/// Sequential Exchange
#[doc(hidden)]
#[deprecated(
since = "0.2.72",
note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead"
)]
pub const IPPROTO_SEP: ::c_int = 33;
/// Datagram Congestion Control Protocol
pub const IPPROTO_DCCP: ::c_int = 33;
/// Third Party Connect
pub const IPPROTO_3PC: ::c_int = 34;
/// InterDomain Policy Routing