Skip to content

Commit f7de365

Browse files
committed
Auto merge of #1497 - asomers:rlim_nlimits, r=gnzlbg
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.
2 parents e61ec82 + ac1e124 commit f7de365

File tree

7 files changed

+28
-0
lines changed

7 files changed

+28
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,10 @@ pub const RLIMIT_RSS: ::c_int = RLIMIT_AS;
18621862
pub const RLIMIT_MEMLOCK: ::c_int = 6;
18631863
pub const RLIMIT_NPROC: ::c_int = 7;
18641864
pub const RLIMIT_NOFILE: ::c_int = 8;
1865+
#[deprecated(
1866+
since = "0.2.64",
1867+
note = "Not stable across OS versions"
1868+
)]
18651869
pub const RLIM_NLIMITS: ::c_int = 9;
18661870
pub const _RLIMIT_POSIX_FLAG: ::c_int = 0x1000;
18671871

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ pub const ENOMEDIUM: ::c_int = 93;
451451
pub const EASYNC: ::c_int = 99;
452452
pub const ELAST: ::c_int = 99;
453453
pub const RLIMIT_POSIXLOCKS: ::c_int = 11;
454+
#[deprecated(
455+
since = "0.2.64",
456+
note = "Not stable across OS versions"
457+
)]
454458
pub const RLIM_NLIMITS: ::rlim_t = 12;
455459

456460
pub const Q_GETQUOTA: ::c_int = 0x300;

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ pub const RLIMIT_NPTS: ::c_int = 11;
337337
pub const RLIMIT_SWAP: ::c_int = 12;
338338
pub const RLIMIT_KQUEUES: ::c_int = 13;
339339
pub const RLIMIT_UMTXP: ::c_int = 14;
340+
#[deprecated(
341+
since = "0.2.64",
342+
note = "Not stable across OS versions"
343+
)]
340344
pub const RLIM_NLIMITS: ::rlim_t = 15;
341345

342346
pub const Q_GETQUOTA: ::c_int = 0x700;

src/unix/bsd/netbsdlike/netbsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,10 @@ pub const O_RSYNC : ::c_int = 0x00020000;
741741
pub const MS_SYNC : ::c_int = 0x4;
742742
pub const MS_INVALIDATE : ::c_int = 0x2;
743743

744+
#[deprecated(
745+
since = "0.2.64",
746+
note = "Not stable across OS versions"
747+
)]
744748
pub const RLIM_NLIMITS: ::c_int = 12;
745749

746750
pub const EIDRM: ::c_int = 82;

src/unix/bsd/netbsdlike/openbsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,10 @@ pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x02;
757757
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x04;
758758
pub const AT_REMOVEDIR: ::c_int = 0x08;
759759

760+
#[deprecated(
761+
since = "0.2.64",
762+
note = "Not stable across OS versions"
763+
)]
760764
pub const RLIM_NLIMITS: ::c_int = 9;
761765

762766
pub const SO_TIMESTAMP: ::c_int = 0x0800;

src/unix/linux_like/linux/musl/b32/hexagon.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ pub const RLIMIT_MEMLOCK: ::c_int = 8;
288288
pub const RLIMIT_NOFILE: ::c_int = 7;
289289
pub const RLIMIT_NPROC: ::c_int = 6;
290290
pub const RLIMIT_RSS: ::c_int = 5;
291+
#[deprecated(
292+
since = "0.2.64",
293+
note = "Not stable across OS versions"
294+
)]
291295
pub const RLIM_NLIMITS: ::c_int = 16;
292296
pub const SA_ONSTACK: ::c_int = 0x08000000;
293297
pub const SA_SIGINFO: ::c_int = 0x00000004;

src/unix/solarish/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,10 @@ pub const RLIMIT_NOFILE: ::c_int = 5;
11991199
pub const RLIMIT_VMEM: ::c_int = 6;
12001200
pub const RLIMIT_AS: ::c_int = RLIMIT_VMEM;
12011201

1202+
#[deprecated(
1203+
since = "0.2.64",
1204+
note = "Not stable across OS versions"
1205+
)]
12021206
pub const RLIM_NLIMITS: rlim_t = 7;
12031207
pub const RLIM_INFINITY: rlim_t = 0x7fffffff;
12041208

0 commit comments

Comments
 (0)