Skip to content

Commit 0ecafc3

Browse files
committed
Consolidate and fix musl-specific definitions.
Musl 1.1.14 defined these incorrectly, and we followed suit. They're fixed in 1.1.15, so we fix them here as well. Since these are kernel ABIs, the correct values match other libc implementations, so we move them up to the topmost module possible.
1 parent 8ff1c41 commit 0ecafc3

File tree

10 files changed

+5
-16
lines changed

10 files changed

+5
-16
lines changed

src/unix/notbsd/linux/mips.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,10 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
233233
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
234234
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
235235
pub const _SC_2_C_VERSION: ::c_int = 96;
236-
pub const RUSAGE_THREAD: ::c_int = 1;
237236
pub const O_ACCMODE: ::c_int = 3;
238237
pub const O_DIRECT: ::c_int = 0x8000;
239238
pub const O_DIRECTORY: ::c_int = 0x10000;
240239
pub const O_NOFOLLOW: ::c_int = 0x20000;
241-
pub const RUSAGE_CHILDREN: ::c_int = -1;
242240
pub const ST_RELATIME: ::c_ulong = 4096;
243241
pub const NI_MAXHOST: ::socklen_t = 1025;
244242

src/unix/notbsd/linux/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ pub const CODESET: ::nl_item = 14;
281281

282282
pub const CRNCYSTR: ::nl_item = 0x4000F;
283283

284+
pub const RUSAGE_THREAD: ::c_int = 1;
285+
pub const RUSAGE_CHILDREN: ::c_int = -1;
286+
284287
pub const RADIXCHAR: ::nl_item = 0x10000;
285288
pub const THOUSEP: ::nl_item = 0x10001;
286289

src/unix/notbsd/linux/musl/b32/arm.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,5 @@ pub const TIOCCONS: ::c_int = 0x541D;
332332
pub const SYS_gettid: ::c_long = 224;
333333
pub const SYS_perf_event_open: ::c_long = 364;
334334

335-
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
336-
pub const RUSAGE_CHILDREN: ::c_int = 1;
337335
pub const POLLWRNORM: ::c_short = 0x100;
338336
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b32/asmjs.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,5 @@ pub const TIOCCONS: ::c_int = 0x541D;
331331

332332
pub const SYS_gettid: ::c_long = 224; // Valid for arm (32-bit) and x86 (32-bit)
333333

334-
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
335-
pub const RUSAGE_CHILDREN: ::c_int = 1;
336334
pub const POLLWRNORM: ::c_short = 0x100;
337335
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b32/mips.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,5 @@ pub const TIOCCONS: ::c_int = 0x80047478;
340340
pub const SYS_gettid: ::c_long = 4222; // Valid for O32
341341
pub const SYS_perf_event_open: ::c_long = 4333; // Valid for O32
342342

343-
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
344-
pub const RUSAGE_CHILDREN: ::c_int = !0;
345343
pub const POLLWRNORM: ::c_short = 0x4;
346344
pub const POLLWRBAND: ::c_short = 0x100;

src/unix/notbsd/linux/musl/b32/x86.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,5 @@ pub const TIOCCONS: ::c_int = 0x541D;
346346
pub const SYS_gettid: ::c_long = 224;
347347
pub const SYS_perf_event_open: ::c_long = 336;
348348

349-
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
350-
pub const RUSAGE_CHILDREN: ::c_int = 1;
351349
pub const POLLWRNORM: ::c_short = 0x100;
352350
pub const POLLWRBAND: ::c_short = 0x200;

src/unix/notbsd/linux/musl/b64/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,6 @@ pub const TIOCMSET: ::c_int = 0x5418;
351351
pub const FIONREAD: ::c_int = 0x541B;
352352
pub const TIOCCONS: ::c_int = 0x541D;
353353

354-
pub const POSIX_MADV_DONTNEED: ::c_int = 0;
355-
pub const RUSAGE_CHILDREN: ::c_int = 1;
356354
pub const POLLWRNORM: ::c_short = 0x100;
357355
pub const POLLWRBAND: ::c_short = 0x200;
358356

src/unix/notbsd/linux/musl/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ pub const PTHREAD_STACK_MIN: ::size_t = 2048;
7777
pub const POSIX_FADV_DONTNEED: ::c_int = 4;
7878
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
7979

80+
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
81+
8082
pub const RLIM_INFINITY: ::rlim_t = !0;
8183
pub const RLIMIT_RTTIME: ::c_int = 15;
8284
pub const RLIMIT_NLIMITS: ::c_int = 16;

src/unix/notbsd/linux/other/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,9 @@ pub const POSIX_FADV_DONTNEED: ::c_int = 4;
360360
pub const POSIX_FADV_NOREUSE: ::c_int = 5;
361361
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
362362
pub const _SC_2_C_VERSION: ::c_int = 96;
363-
pub const RUSAGE_THREAD: ::c_int = 1;
364363
pub const O_ACCMODE: ::c_int = 3;
365364
pub const O_ASYNC: ::c_int = 0x2000;
366365
pub const O_NDELAY: ::c_int = 0x800;
367-
pub const RUSAGE_CHILDREN: ::c_int = -1;
368366
pub const ST_RELATIME: ::c_ulong = 4096;
369367
pub const NI_MAXHOST: ::socklen_t = 1025;
370368

src/unix/notbsd/linux/s390x.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,8 @@ pub const TMP_MAX: ::c_uint = 238328;
464464
pub const FOPEN_MAX: ::c_uint = 16;
465465
pub const POSIX_MADV_DONTNEED: ::c_int = 4;
466466
pub const _SC_2_C_VERSION: ::c_int = 96;
467-
pub const RUSAGE_THREAD: ::c_int = 1;
468467
pub const O_ASYNC: ::c_int = 0x2000;
469468
pub const O_NDELAY: ::c_int = 0x800;
470-
pub const RUSAGE_CHILDREN: ::c_int = -1;
471469
pub const ST_RELATIME: ::c_ulong = 4096;
472470
pub const NI_MAXHOST: ::socklen_t = 1025;
473471

0 commit comments

Comments
 (0)