Skip to content

Commit e9b1ee4

Browse files
asomerstgross35
authored andcommitted
Deprecate FreeBSD's CAP_UNUSED* and CAP_ALL* constants
They aren't stable across OS versions, and they don't have any legitimate use in applications.
1 parent cec6aa9 commit e9b1ee4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

libc-test/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,6 +2649,11 @@ fn test_freebsd(target: &str) {
26492649
// Added in FreeBSD 14.0
26502650
"TCP_FUNCTION_ALIAS" if Some(14) > freebsd_ver => true,
26512651

2652+
// These constants may change or disappear in future OS releases, and they probably
2653+
// have no legitimate use in applications anyway.
2654+
"CAP_UNUSED0_44" | "CAP_UNUSED0_57" | "CAP_UNUSED1_22" | "CAP_UNUSED1_57" |
2655+
"CAP_ALL0" | "CAP_ALL1" => true,
2656+
26522657
_ => false,
26532658
}
26542659
});

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,8 +2711,11 @@ pub const CAP_SOCK_SERVER: u64 = CAP_ACCEPT
27112711
| CAP_SEND
27122712
| CAP_SETSOCKOPT
27132713
| CAP_SHUTDOWN;
2714+
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
27142715
pub const CAP_ALL0: u64 = cap_right!(0, 0x000007FFFFFFFFFFu64);
2716+
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
27152717
pub const CAP_UNUSED0_44: u64 = cap_right!(0, 0x0000080000000000u64);
2718+
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
27162719
pub const CAP_UNUSED0_57: u64 = cap_right!(0, 0x0100000000000000u64);
27172720
pub const CAP_MAC_GET: u64 = cap_right!(1, 0x0000000000000001u64);
27182721
pub const CAP_MAC_SET: u64 = cap_right!(1, 0x0000000000000002u64);
@@ -2736,8 +2739,11 @@ pub const CAP_ACL_GET: u64 = cap_right!(1, 0x0000000000040000u64);
27362739
pub const CAP_ACL_SET: u64 = cap_right!(1, 0x0000000000080000u64);
27372740
pub const CAP_KQUEUE_CHANGE: u64 = cap_right!(1, 0x0000000000100000u64);
27382741
pub const CAP_KQUEUE: u64 = CAP_KQUEUE_EVENT | CAP_KQUEUE_CHANGE;
2742+
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
27392743
pub const CAP_ALL1: u64 = cap_right!(1, 0x00000000001FFFFFu64);
2744+
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
27402745
pub const CAP_UNUSED1_22: u64 = cap_right!(1, 0x0000000000200000u64);
2746+
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
27412747
pub const CAP_UNUSED1_57: u64 = cap_right!(1, 0x0100000000000000u64);
27422748
pub const CAP_FCNTL_GETFL: u32 = 1 << 3;
27432749
pub const CAP_FCNTL_SETFL: u32 = 1 << 4;

0 commit comments

Comments
 (0)