From b3cf87fe2a2b038933c74b7c96e90fe9da09e9a7 Mon Sep 17 00:00:00 2001 From: Brian Cain Date: Fri, 1 Sep 2023 19:31:53 -0700 Subject: [PATCH] Remove deprecation from SA_ONSTACK In ad3f860b3cc7314331bbed1a925bce9d01b247df the RLIM_* values were removed, but leaving behind a deprecation about RLIM_NLIMITS caused it to incorrectly apply instead to SA_ONSTACK. The deprecated SA_ONSTACK causes the libstd build for hexagon-unknown-linux-musl to fail. Also: apply RLIM*_NLIMITS deprecation to linux, emscripten, fuchsia, AIX, Haiku, NTO --- src/fuchsia/mod.rs | 3 +++ src/unix/aix/mod.rs | 1 + src/unix/haiku/mod.rs | 1 + src/unix/linux_like/android/mod.rs | 1 + src/unix/linux_like/emscripten/mod.rs | 3 +++ src/unix/linux_like/linux/arch/generic/mod.rs | 7 +++++++ src/unix/linux_like/linux/arch/mips/mod.rs | 7 +++++++ src/unix/linux_like/linux/arch/powerpc/mod.rs | 6 ++++++ src/unix/linux_like/linux/arch/sparc/mod.rs | 3 +++ src/unix/linux_like/linux/musl/b32/hexagon.rs | 1 - src/unix/nto/mod.rs | 1 + 11 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/fuchsia/mod.rs b/src/fuchsia/mod.rs index e8c8719f9cbac..bf1a543609406 100644 --- a/src/fuchsia/mod.rs +++ b/src/fuchsia/mod.rs @@ -2811,7 +2811,10 @@ pub const POSIX_MADV_DONTNEED: ::c_int = 4; pub const RLIM_INFINITY: ::rlim_t = !0; pub const RLIMIT_RTTIME: ::c_int = 15; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIMIT_NLIMITS: ::c_int = 16; +#[allow(deprecated)] +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS; pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; diff --git a/src/unix/aix/mod.rs b/src/unix/aix/mod.rs index bc02b108dc412..66e4b7cf67204 100644 --- a/src/unix/aix/mod.rs +++ b/src/unix/aix/mod.rs @@ -1762,6 +1762,7 @@ pub const PRIO_USER: ::c_int = 2; pub const RUSAGE_THREAD: ::c_int = 1; pub const RLIM_SAVED_MAX: ::c_ulong = RLIM_INFINITY - 1; pub const RLIM_SAVED_CUR: ::c_ulong = RLIM_INFINITY - 2; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: ::c_int = 10; // sys/sched.h diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 8bfb78b786753..00e9523c9865a 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -741,6 +741,7 @@ pub const RLIMIT_AS: ::c_int = 6; pub const RLIM_INFINITY: ::rlim_t = 0xffffffff; // Haiku specific pub const RLIMIT_NOVMON: ::c_int = 7; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: ::c_int = 8; pub const RUSAGE_SELF: ::c_int = 0; diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index cdac6c32ee3f4..b2ef7973806dd 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -1562,6 +1562,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; diff --git a/src/unix/linux_like/emscripten/mod.rs b/src/unix/linux_like/emscripten/mod.rs index 0457f5dadea70..1c9e4e6f5b178 100644 --- a/src/unix/linux_like/emscripten/mod.rs +++ b/src/unix/linux_like/emscripten/mod.rs @@ -1230,7 +1230,10 @@ pub const POSIX_FADV_NOREUSE: ::c_int = 5; pub const POSIX_MADV_DONTNEED: ::c_int = 0; pub const RLIM_INFINITY: ::rlim_t = !0; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIMIT_NLIMITS: ::c_int = 15; +#[allow(deprecated)] +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS; pub const MAP_ANONYMOUS: ::c_int = MAP_ANON; diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 19d5e7b3938c1..10e1fcca630dd 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -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"))] { @@ -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; } } diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs index 975e334de5ffb..6c0aecf8cbac3 100644 --- a/src/unix/linux_like/linux/arch/mips/mod.rs +++ b/src/unix/linux_like/linux/arch/mips/mod.rs @@ -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")] { @@ -257,7 +259,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; pub const RLIM_INFINITY: ::rlim_t = !0; } @@ -265,8 +270,10 @@ cfg_if! { 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; } } diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs index 64c3eaab543a6..584be5b6c2860 100644 --- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs @@ -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")] { @@ -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; } } diff --git a/src/unix/linux_like/linux/arch/sparc/mod.rs b/src/unix/linux_like/linux/arch/sparc/mod.rs index da3e388e3d286..c7813aa46be61 100644 --- a/src/unix/linux_like/linux/arch/sparc/mod.rs +++ b/src/unix/linux_like/linux/arch/sparc/mod.rs @@ -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! { diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs index f83d208d5fe8f..49e000ce97f1e 100644 --- a/src/unix/linux_like/linux/musl/b32/hexagon.rs +++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs @@ -265,7 +265,6 @@ pub const PF_FILE: ::c_int = 1; pub const PF_KCM: ::c_int = 41; pub const PF_MAX: ::c_int = 43; pub const PF_QIPCRTR: ::c_int = 42; -#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 0x00000004; pub const SA_NOCLDWAIT: ::c_int = 0x00000002; diff --git a/src/unix/nto/mod.rs b/src/unix/nto/mod.rs index ed6f6df41368e..91e531ffd7961 100644 --- a/src/unix/nto/mod.rs +++ b/src/unix/nto/mod.rs @@ -2557,6 +2557,7 @@ pub const RLIMIT_NPROC: ::c_int = 8; pub const RLIMIT_RSS: ::c_int = 6; pub const RLIMIT_STACK: ::c_int = 3; pub const RLIMIT_VMEM: ::c_int = 6; +#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] pub const RLIM_NLIMITS: ::c_int = 14; pub const SCHED_ADJTOHEAD: ::c_int = 5;