Skip to content

Commit 13b61d6

Browse files
committed
Auto merge of #3505 - GuillaumeGomez:new-consts, r=JohnTitor
Add constants from <include/linux/sched.h> Needed for `sysinfo` as usual. :) Constants come from https://github.com/torvalds/linux/blob/master/include/linux/sched.h.
2 parents ede935a + 5c19755 commit 13b61d6

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

libc-test/build.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4059,6 +4059,33 @@ fn test_linux(target: &str) {
40594059
true
40604060
}
40614061

4062+
// FIXME: seems to not be available all the time (from <include/linux/sched.h>:
4063+
"PF_VCPU"
4064+
| "PF_IDLE"
4065+
| "PF_EXITING"
4066+
| "PF_POSTCOREDUMP"
4067+
| "PF_IO_WORKER"
4068+
| "PF_WQ_WORKER"
4069+
| "PF_FORKNOEXEC"
4070+
| "PF_MCE_PROCESS"
4071+
| "PF_SUPERPRIV"
4072+
| "PF_DUMPCORE"
4073+
| "PF_SIGNALED"
4074+
| "PF_MEMALLOC"
4075+
| "PF_NPROC_EXCEEDED"
4076+
| "PF_USED_MATH"
4077+
| "PF_USER_WORKER"
4078+
| "PF_NOFREEZE"
4079+
| "PF_KSWAPD"
4080+
| "PF_MEMALLOC_NOFS"
4081+
| "PF_MEMALLOC_NOIO"
4082+
| "PF_LOCAL_THROTTLE"
4083+
| "PF_KTHREAD"
4084+
| "PF_RANDOMIZE"
4085+
| "PF_NO_SETAFFINITY"
4086+
| "PF_MCE_EARLY"
4087+
| "PF_MEMALLOC_PIN" => true,
4088+
40624089
_ => false,
40634090
}
40644091
});

src/unix/linux_like/linux/mod.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4519,6 +4519,33 @@ pub const NET_NETFILTER: ::c_int = 19;
45194519
pub const NET_DCCP: ::c_int = 20;
45204520
pub const NET_IRDA: ::c_int = 412;
45214521

4522+
// include/linux/sched.h
4523+
pub const PF_VCPU: ::c_int = 0x00000001;
4524+
pub const PF_IDLE: ::c_int = 0x00000002;
4525+
pub const PF_EXITING: ::c_int = 0x00000004;
4526+
pub const PF_POSTCOREDUMP: ::c_int = 0x00000008;
4527+
pub const PF_IO_WORKER: ::c_int = 0x00000010;
4528+
pub const PF_WQ_WORKER: ::c_int = 0x00000020;
4529+
pub const PF_FORKNOEXEC: ::c_int = 0x00000040;
4530+
pub const PF_MCE_PROCESS: ::c_int = 0x00000080;
4531+
pub const PF_SUPERPRIV: ::c_int = 0x00000100;
4532+
pub const PF_DUMPCORE: ::c_int = 0x00000200;
4533+
pub const PF_SIGNALED: ::c_int = 0x00000400;
4534+
pub const PF_MEMALLOC: ::c_int = 0x00000800;
4535+
pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000;
4536+
pub const PF_USED_MATH: ::c_int = 0x00002000;
4537+
pub const PF_USER_WORKER: ::c_int = 0x00004000;
4538+
pub const PF_NOFREEZE: ::c_int = 0x00008000;
4539+
pub const PF_KSWAPD: ::c_int = 0x00020000;
4540+
pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000;
4541+
pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000;
4542+
pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000;
4543+
pub const PF_KTHREAD: ::c_int = 0x00200000;
4544+
pub const PF_RANDOMIZE: ::c_int = 0x00400000;
4545+
pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000;
4546+
pub const PF_MCE_EARLY: ::c_int = 0x08000000;
4547+
pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000;
4548+
45224549
f! {
45234550
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
45244551
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)

0 commit comments

Comments
 (0)