Skip to content

Commit

Permalink
Apply deprecation to linux uses of RLIM_NLIMITS
Browse files Browse the repository at this point in the history
The deprecation for RLIM_NLIMITS was unintentionally removed in
ad3f860.
  • Loading branch information
androm3da committed Sep 6, 2023
1 parent f141a1a commit 1681345
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,7 @@ pub const RLIMIT_MSGQUEUE: ::c_int = 12;
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;

#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 16;
pub const RLIM_INFINITY: ::rlim_t = !0;

Expand Down
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/arch/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ cfg_if! {
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;

} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
Expand All @@ -277,16 +279,21 @@ cfg_if! {
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
}
}

cfg_if! {
if #[cfg(target_env = "gnu")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
}
else if #[cfg(target_env = "uclibc")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/arch/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ cfg_if! {
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;

} else if #[cfg(target_env = "musl")] {
Expand All @@ -257,16 +259,21 @@ cfg_if! {
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
pub const RLIM_INFINITY: ::rlim_t = !0;
}
}

cfg_if! {
if #[cfg(target_env = "gnu")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
} else if #[cfg(target_env = "uclibc")] {
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 15;
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/unix/linux_like/linux/arch/powerpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ cfg_if! {
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;

} else if #[cfg(target_env = "musl")] {
Expand All @@ -236,7 +239,10 @@ cfg_if! {
pub const RLIMIT_NICE: ::c_int = 13;
pub const RLIMIT_RTPRIO: ::c_int = 14;
pub const RLIMIT_RTTIME: ::c_int = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::c_int = 15;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::c_int = RLIM_NLIMITS;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/linux/arch/sparc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ pub const RLIMIT_MSGQUEUE: ::__rlimit_resource_t = 12;
pub const RLIMIT_NICE: ::__rlimit_resource_t = 13;
pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIM_NLIMITS: ::__rlimit_resource_t = 16;
#[allow(deprecated)]
#[deprecated(since = "0.2.64", note = "Not stable across OS versions")]
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = RLIM_NLIMITS;

cfg_if! {
Expand Down

0 comments on commit 1681345

Please sign in to comment.