Skip to content

Commit 8cbf756

Browse files
authored
Merge pull request #3536 from GuillaumeGomez/constants-android
Add missing constants for Android
2 parents 263c191 + 9bddac4 commit 8cbf756

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

libc-test/build.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,6 +1907,34 @@ fn test_android(target: &str) {
19071907
// FIXME: The value has been changed on r26b:
19081908
| "SYS_syscalls" if aarch64 => true,
19091909

1910+
// From `<include/linux/sched.h>`.
1911+
| "PF_VCPU"
1912+
| "PF_IDLE"
1913+
| "PF_EXITING"
1914+
| "PF_POSTCOREDUMP"
1915+
| "PF_IO_WORKER"
1916+
| "PF_WQ_WORKER"
1917+
| "PF_FORKNOEXEC"
1918+
| "PF_SUPERPRIV"
1919+
| "PF_DUMPCORE"
1920+
| "PF_MCE_PROCESS"
1921+
| "PF_SIGNALED"
1922+
| "PF_MEMALLOC"
1923+
| "PF_NPROC_EXCEEDED"
1924+
| "PF_USED_MATH"
1925+
| "PF_USER_WORKER"
1926+
| "PF_NOFREEZE"
1927+
| "PF_KSWAPD"
1928+
| "PF_MEMALLOC_NOFS"
1929+
| "PF_MEMALLOC_NOIO"
1930+
| "PF_LOCAL_THROTTLE"
1931+
| "PF_KTHREAD"
1932+
| "PF_RANDOMIZE"
1933+
| "PF_NO_SETAFFINITY"
1934+
| "PF_MCE_EARLY"
1935+
| "PF_MEMALLOC_PIN"
1936+
| "PF_SUSPEND_TASK" => true,
1937+
19101938
_ => false,
19111939
}
19121940
});

src/unix/linux_like/android/mod.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,6 +3455,37 @@ pub const NET_DCCP: ::c_int = 20;
34553455
pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26;
34563456
pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT;
34573457

3458+
// include/linux/sched.h
3459+
pub const PF_VCPU: ::c_int = 0x00000001;
3460+
pub const PF_IDLE: ::c_int = 0x00000002;
3461+
pub const PF_EXITING: ::c_int = 0x00000004;
3462+
pub const PF_POSTCOREDUMP: ::c_int = 0x00000008;
3463+
pub const PF_IO_WORKER: ::c_int = 0x00000010;
3464+
pub const PF_WQ_WORKER: ::c_int = 0x00000020;
3465+
pub const PF_FORKNOEXEC: ::c_int = 0x00000040;
3466+
pub const PF_MCE_PROCESS: ::c_int = 0x00000080;
3467+
pub const PF_SUPERPRIV: ::c_int = 0x00000100;
3468+
pub const PF_DUMPCORE: ::c_int = 0x00000200;
3469+
pub const PF_SIGNALED: ::c_int = 0x00000400;
3470+
pub const PF_MEMALLOC: ::c_int = 0x00000800;
3471+
pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000;
3472+
pub const PF_USED_MATH: ::c_int = 0x00002000;
3473+
pub const PF_USER_WORKER: ::c_int = 0x00004000;
3474+
pub const PF_NOFREEZE: ::c_int = 0x00008000;
3475+
3476+
pub const PF_KSWAPD: ::c_int = 0x00020000;
3477+
pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000;
3478+
pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000;
3479+
pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000;
3480+
pub const PF_KTHREAD: ::c_int = 0x00200000;
3481+
pub const PF_RANDOMIZE: ::c_int = 0x00400000;
3482+
3483+
pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000;
3484+
pub const PF_MCE_EARLY: ::c_int = 0x08000000;
3485+
pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000;
3486+
3487+
pub const PF_SUSPEND_TASK: ::c_int = 0x80000000;
3488+
34583489
// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the
34593490
// following are only available on newer Linux versions than the versions
34603491
// currently used in CI in some configurations, so we define them here.

0 commit comments

Comments
 (0)