From ac1e12409ef18d46240f48e432026951ff02e4a6 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Mon, 2 Sep 2019 10:21:57 -0600 Subject: [PATCH] Deprecate RLIM_NLIMITS This constant is not stable across OS versions, so it cannot be used in any backwards- or forwards- compatible way. It's typically used to size arrays in the kernel and in debugging utilities that are closely tied to the OS version. Since libc is ignorant about OS versions, we shouldn't even be defining it. --- src/unix/bsd/apple/mod.rs | 4 ++++ src/unix/bsd/freebsdlike/dragonfly/mod.rs | 4 ++++ src/unix/bsd/freebsdlike/freebsd/mod.rs | 4 ++++ src/unix/bsd/netbsdlike/netbsd/mod.rs | 4 ++++ src/unix/bsd/netbsdlike/openbsd/mod.rs | 4 ++++ src/unix/linux_like/linux/musl/b32/hexagon.rs | 4 ++++ src/unix/solarish/mod.rs | 4 ++++ 7 files changed, 28 insertions(+) diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 6d0a5bfe..ced51703 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -1862,6 +1862,10 @@ pub const RLIMIT_RSS: ::c_int = RLIMIT_AS; pub const RLIMIT_MEMLOCK: ::c_int = 6; pub const RLIMIT_NPROC: ::c_int = 7; pub const RLIMIT_NOFILE: ::c_int = 8; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: ::c_int = 9; pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000; diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs index fc94fd3c..9e9dc384 100644 --- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs +++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs @@ -451,6 +451,10 @@ pub const ENOMEDIUM: ::c_int = 93; pub const EASYNC: ::c_int = 99; pub const ELAST: ::c_int = 99; pub const RLIMIT_POSIXLOCKS: ::c_int = 11; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: ::rlim_t = 12; pub const Q_GETQUOTA: ::c_int = 0x300; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 9329d7f8..c4ad2b39 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -337,6 +337,10 @@ pub const RLIMIT_NPTS: ::c_int = 11; pub const RLIMIT_SWAP: ::c_int = 12; pub const RLIMIT_KQUEUES: ::c_int = 13; pub const RLIMIT_UMTXP: ::c_int = 14; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: ::rlim_t = 15; pub const Q_GETQUOTA: ::c_int = 0x700; diff --git a/src/unix/bsd/netbsdlike/netbsd/mod.rs b/src/unix/bsd/netbsdlike/netbsd/mod.rs index 9401c024..74b2334d 100644 --- a/src/unix/bsd/netbsdlike/netbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/netbsd/mod.rs @@ -741,6 +741,10 @@ pub const O_RSYNC : ::c_int = 0x00020000; pub const MS_SYNC : ::c_int = 0x4; pub const MS_INVALIDATE : ::c_int = 0x2; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: ::c_int = 12; pub const EIDRM: ::c_int = 82; diff --git a/src/unix/bsd/netbsdlike/openbsd/mod.rs b/src/unix/bsd/netbsdlike/openbsd/mod.rs index b50d8154..ffefefd8 100644 --- a/src/unix/bsd/netbsdlike/openbsd/mod.rs +++ b/src/unix/bsd/netbsdlike/openbsd/mod.rs @@ -757,6 +757,10 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02; pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04; pub const AT_REMOVEDIR: ::c_int = 0x08; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: ::c_int = 9; pub const SO_TIMESTAMP: ::c_int = 0x0800; diff --git a/src/unix/linux_like/linux/musl/b32/hexagon.rs b/src/unix/linux_like/linux/musl/b32/hexagon.rs index c8666925..2ff186f0 100644 --- a/src/unix/linux_like/linux/musl/b32/hexagon.rs +++ b/src/unix/linux_like/linux/musl/b32/hexagon.rs @@ -288,6 +288,10 @@ pub const RLIMIT_MEMLOCK: ::c_int = 8; pub const RLIMIT_NOFILE: ::c_int = 7; pub const RLIMIT_NPROC: ::c_int = 6; pub const RLIMIT_RSS: ::c_int = 5; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: ::c_int = 16; pub const SA_ONSTACK: ::c_int = 0x08000000; pub const SA_SIGINFO: ::c_int = 0x00000004; diff --git a/src/unix/solarish/mod.rs b/src/unix/solarish/mod.rs index f8a64547..5582e271 100644 --- a/src/unix/solarish/mod.rs +++ b/src/unix/solarish/mod.rs @@ -1199,6 +1199,10 @@ pub const RLIMIT_NOFILE: ::c_int = 5; pub const RLIMIT_VMEM: ::c_int = 6; pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM; +#[deprecated( + since = "0.2.64", + note = "Not stable across OS versions" +)] pub const RLIM_NLIMITS: rlim_t = 7; pub const RLIM_INFINITY: rlim_t = 0x7fffffff;