Skip to content

Commit

Permalink
Remove deprecation from SA_ONSTACK
Browse files Browse the repository at this point in the history
In ad3f860 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
  • Loading branch information
androm3da committed Sep 30, 2023
1 parent 6e02a32 commit b3cf87f
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/fuchsia/mod.rs
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/unix/aix/mod.rs
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/unix/haiku/mod.rs
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/android/mod.rs
Expand Up @@ -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;

Expand Down
3 changes: 3 additions & 0 deletions src/unix/linux_like/emscripten/mod.rs
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions src/unix/linux_like/linux/arch/generic/mod.rs
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
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
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
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
1 change: 0 additions & 1 deletion src/unix/linux_like/linux/musl/b32/hexagon.rs
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/unix/nto/mod.rs
Expand Up @@ -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;
Expand Down

0 comments on commit b3cf87f

Please sign in to comment.