Skip to content

Commit

Permalink
Auto merge of #1497 - asomers:rlim_nlimits, r=gnzlbg
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Sep 7, 2019
2 parents e61ec82 + ac1e124 commit f7de365
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/unix/bsd/apple/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/bsd/netbsdlike/openbsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/linux_like/linux/musl/b32/hexagon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/unix/solarish/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f7de365

Please sign in to comment.