Skip to content

Commit e742043

Browse files
authored
Merge pull request #1770 from JohnTitor/fix-prio-which
Re-define `__priority_which`s as c_uint in linux-gnu
2 parents f8f9a8e + f9f5683 commit e742043

File tree

12 files changed

+44
-4
lines changed

12 files changed

+44
-4
lines changed

src/unix/bsd/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,10 @@ pub const REG_BACKR: ::c_int = 0o02000;
501501
pub const TIOCCBRK: ::c_uint = 0x2000747a;
502502
pub const TIOCSBRK: ::c_uint = 0x2000747b;
503503

504+
pub const PRIO_PROCESS: ::c_int = 0;
505+
pub const PRIO_PGRP: ::c_int = 1;
506+
pub const PRIO_USER: ::c_int = 2;
507+
504508
f! {
505509
pub fn CMSG_FIRSTHDR(mhdr: *const ::msghdr) -> *mut ::cmsghdr {
506510
if (*mhdr).msg_controllen as usize >= ::mem::size_of::<::cmsghdr>() {

src/unix/haiku/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,10 @@ pub const TIOCCBRK: ::c_int = TCGETA + 21;
12061206
pub const TIOCMBIS: ::c_int = TCGETA + 22;
12071207
pub const TIOCMBIC: ::c_int = TCGETA + 23;
12081208

1209+
pub const PRIO_PROCESS: ::c_int = 0;
1210+
pub const PRIO_PGRP: ::c_int = 1;
1211+
pub const PRIO_USER: ::c_int = 2;
1212+
12091213
f! {
12101214
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
12111215
let fd = fd as usize;

src/unix/hermit/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -939,6 +939,10 @@ const ULONG_SIZE: usize = 64;
939939

940940
pub const WNOHANG: ::c_int = 0x00000001;
941941

942+
pub const PRIO_PROCESS: ::c_int = 0;
943+
pub const PRIO_PGRP: ::c_int = 1;
944+
pub const PRIO_USER: ::c_int = 2;
945+
942946
f! {
943947
pub fn WEXITSTATUS(status: ::c_int) -> ::c_int {
944948
(status >> 8) & 0xff

src/unix/linux_like/android/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,6 +2144,10 @@ pub const EDOM: ::c_int = 33;
21442144
pub const ERANGE: ::c_int = 34;
21452145
pub const EWOULDBLOCK: ::c_int = EAGAIN;
21462146

2147+
pub const PRIO_PROCESS: ::c_int = 0;
2148+
pub const PRIO_PGRP: ::c_int = 1;
2149+
pub const PRIO_USER: ::c_int = 2;
2150+
21472151
f! {
21482152
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
21492153
cmsg: *const cmsghdr) -> *mut cmsghdr {

src/unix/linux_like/emscripten/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,10 @@ pub const ARPD_LOOKUP: ::c_ushort = 0x02;
16801680
pub const ARPD_FLUSH: ::c_ushort = 0x03;
16811681
pub const ATF_MAGIC: ::c_int = 0x80;
16821682

1683+
pub const PRIO_PROCESS: ::c_int = 0;
1684+
pub const PRIO_PGRP: ::c_int = 1;
1685+
pub const PRIO_USER: ::c_int = 2;
1686+
16831687
f! {
16841688
pub fn CMSG_NXTHDR(mhdr: *const msghdr,
16851689
cmsg: *const cmsghdr) -> *mut cmsghdr {

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ pub const RLIMIT_RTPRIO: ::__rlimit_resource_t = 14;
465465
pub const RLIMIT_RTTIME: ::__rlimit_resource_t = 15;
466466
pub const RLIMIT_NLIMITS: ::__rlimit_resource_t = 16;
467467

468+
pub const PRIO_PROCESS: ::__priority_which_t = 0;
469+
pub const PRIO_PGRP: ::__priority_which_t = 1;
470+
pub const PRIO_USER: ::__priority_which_t = 2;
471+
468472
pub const MS_RMT_MASK: ::c_ulong = 0x02800051;
469473

470474
pub const __UT_LINESIZE: usize = 32;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ pub const REG_OK: ::c_int = 0;
425425
pub const TIOCSBRK: ::c_int = 0x5427;
426426
pub const TIOCCBRK: ::c_int = 0x5428;
427427

428+
pub const PRIO_PROCESS: ::c_int = 0;
429+
pub const PRIO_PGRP: ::c_int = 1;
430+
pub const PRIO_USER: ::c_int = 2;
431+
428432
extern "C" {
429433
pub fn sendmmsg(
430434
sockfd: ::c_int,

src/unix/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,6 @@ pub const LOG_NOWAIT: ::c_int = 0x10;
269269
pub const LOG_PRIMASK: ::c_int = 7;
270270
pub const LOG_FACMASK: ::c_int = 0x3f8;
271271

272-
pub const PRIO_PROCESS: ::c_int = 0;
273-
pub const PRIO_PGRP: ::c_int = 1;
274-
pub const PRIO_USER: ::c_int = 2;
275-
276272
pub const PRIO_MIN: ::c_int = -20;
277273
pub const PRIO_MAX: ::c_int = 20;
278274

src/unix/newlib/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ pub const EAI_MEMORY: ::c_int = -304;
547547
pub const EAI_NONAME: ::c_int = -305;
548548
pub const EAI_SOCKTYPE: ::c_int = -307;
549549

550+
pub const PRIO_PROCESS: ::c_int = 0;
551+
pub const PRIO_PGRP: ::c_int = 1;
552+
pub const PRIO_USER: ::c_int = 2;
553+
550554
f! {
551555
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
552556
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;

src/unix/redox/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,10 @@ pub const _PC_ALLOC_SIZE_MIN: ::c_int = 18;
823823
pub const _PC_SYMLINK_MAX: ::c_int = 19;
824824
pub const _PC_2_SYMLINKS: ::c_int = 20;
825825

826+
pub const PRIO_PROCESS: ::c_int = 0;
827+
pub const PRIO_PGRP: ::c_int = 1;
828+
pub const PRIO_USER: ::c_int = 2;
829+
826830
// wait.h
827831
f! {
828832
pub fn WIFSTOPPED(status: ::c_int) -> bool {

src/unix/solarish/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,10 @@ pub const TIME_OOP: i32 = 3;
19951995
pub const TIME_WAIT: i32 = 4;
19961996
pub const TIME_ERROR: i32 = 5;
19971997

1998+
pub const PRIO_PROCESS: ::c_int = 0;
1999+
pub const PRIO_PGRP: ::c_int = 1;
2000+
pub const PRIO_USER: ::c_int = 2;
2001+
19982002
f! {
19992003
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
20002004
let bits = ::mem::size_of_val(&(*set).fds_bits[0]) * 8;

src/unix/uclibc/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,6 +1503,10 @@ pub const NOSTR: ::nl_item = 0x503;
15031503

15041504
pub const FILENAME_MAX: ::c_uint = 4095;
15051505

1506+
pub const PRIO_PROCESS: ::c_int = 0;
1507+
pub const PRIO_PGRP: ::c_int = 1;
1508+
pub const PRIO_USER: ::c_int = 2;
1509+
15061510
f! {
15071511
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
15081512
let fd = fd as usize;

0 commit comments

Comments
 (0)