Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.2] Deprecate FreeBSD's CAP_UNUSED* and CAP_ALL* constants #4183

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2618,6 +2618,11 @@ fn test_freebsd(target: &str) {
// Added in FreeBSD 14.0
"TCP_FUNCTION_ALIAS" if Some(14) > freebsd_ver => true,

// These constants may change or disappear in future OS releases, and they probably
// have no legitimate use in applications anyway.
"CAP_UNUSED0_44" | "CAP_UNUSED0_57" | "CAP_UNUSED1_22" | "CAP_UNUSED1_57" |
"CAP_ALL0" | "CAP_ALL1" => true,

_ => false,
}
});
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2708,8 +2708,11 @@ pub const CAP_SOCK_SERVER: u64 = CAP_ACCEPT
| CAP_SEND
| CAP_SETSOCKOPT
| CAP_SHUTDOWN;
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
pub const CAP_ALL0: u64 = cap_right!(0, 0x000007FFFFFFFFFFu64);
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
pub const CAP_UNUSED0_44: u64 = cap_right!(0, 0x0000080000000000u64);
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
pub const CAP_UNUSED0_57: u64 = cap_right!(0, 0x0100000000000000u64);
pub const CAP_MAC_GET: u64 = cap_right!(1, 0x0000000000000001u64);
pub const CAP_MAC_SET: u64 = cap_right!(1, 0x0000000000000002u64);
Expand All @@ -2733,8 +2736,11 @@ pub const CAP_ACL_GET: u64 = cap_right!(1, 0x0000000000040000u64);
pub const CAP_ACL_SET: u64 = cap_right!(1, 0x0000000000080000u64);
pub const CAP_KQUEUE_CHANGE: u64 = cap_right!(1, 0x0000000000100000u64);
pub const CAP_KQUEUE: u64 = CAP_KQUEUE_EVENT | CAP_KQUEUE_CHANGE;
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
pub const CAP_ALL1: u64 = cap_right!(1, 0x00000000001FFFFFu64);
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
pub const CAP_UNUSED1_22: u64 = cap_right!(1, 0x0000000000200000u64);
#[deprecated(since = "0.2.165", note = "Not stable across OS versions")]
pub const CAP_UNUSED1_57: u64 = cap_right!(1, 0x0100000000000000u64);
pub const CAP_FCNTL_GETFL: u32 = 1 << 3;
pub const CAP_FCNTL_SETFL: u32 = 1 << 4;
Expand Down
Loading