From 738f9014cc9ca67b3c59d8c74d7e4cbbd837df77 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 11 Jan 2024 16:18:42 +0100 Subject: [PATCH 1/3] Add missing constants for Android --- src/unix/linux_like/android/mod.rs | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 94c4eace85539..b213e6daf0d56 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -3468,6 +3468,37 @@ pub const NET_DCCP: ::c_int = 20; pub const HUGETLB_FLAG_ENCODE_SHIFT: ::c_int = 26; pub const MAP_HUGE_SHIFT: ::c_int = HUGETLB_FLAG_ENCODE_SHIFT; +// include/linux/sched.h +pub const PF_VCPU: ::c_int = 0x00000001; +pub const PF_IDLE: ::c_int = 0x00000002; +pub const PF_EXITING: ::c_int = 0x00000004; +pub const PF_POSTCOREDUMP: ::c_int = 0x00000008; +pub const PF_IO_WORKER: ::c_int = 0x00000010; +pub const PF_WQ_WORKER: ::c_int = 0x00000020; +pub const PF_FORKNOEXEC: ::c_int = 0x00000040; +pub const PF_MCE_PROCESS: ::c_int = 0x00000080; +pub const PF_SUPERPRIV: ::c_int = 0x00000100; +pub const PF_DUMPCORE: ::c_int = 0x00000200; +pub const PF_SIGNALED: ::c_int = 0x00000400; +pub const PF_MEMALLOC: ::c_int = 0x00000800; +pub const PF_NPROC_EXCEEDED: ::c_int = 0x00001000; +pub const PF_USED_MATH: ::c_int = 0x00002000; +pub const PF_USER_WORKER: ::c_int = 0x00004000; +pub const PF_NOFREEZE: ::c_int = 0x00008000; + +pub const PF_KSWAPD: ::c_int = 0x00020000; +pub const PF_MEMALLOC_NOFS: ::c_int = 0x00040000; +pub const PF_MEMALLOC_NOIO: ::c_int = 0x00080000; +pub const PF_LOCAL_THROTTLE: ::c_int = 0x00100000; +pub const PF_KTHREAD: ::c_int = 0x00200000; +pub const PF_RANDOMIZE: ::c_int = 0x00400000; + +pub const PF_NO_SETAFFINITY: ::c_int = 0x04000000; +pub const PF_MCE_EARLY: ::c_int = 0x08000000; +pub const PF_MEMALLOC_PIN: ::c_int = 0x10000000; + +pub const PF_SUSPEND_TASK: ::c_int = 0x80000000; + // Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the // following are only available on newer Linux versions than the versions // currently used in CI in some configurations, so we define them here. From d5d370016f3e050c02ff577763d1447e4d9616bb Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 14 Jan 2024 15:23:08 +0100 Subject: [PATCH 2/3] Ignore some android constants not found in tests --- libc-test/build.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 1b65d65f95ec9..841c7cfe66335 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1912,6 +1912,34 @@ fn test_android(target: &str) { // FIXME: The value has been changed on r26b: | "SYS_syscalls" if aarch64 => true, + // From ``. + | "PF_VCPU" + | "PF_IDLE" + | "PF_EXITING" + | "PF_POSTCOREDUMP" + | "PF_IO_WORKER" + | "PF_WQ_WORKER" + | "PF_FORKNOEXEC" + | "PF_SUPERPRIV" + | "PF_DUMPCORE" + | "PF_MCE_PROCESS" + | "PF_SIGNALED" + | "PF_MEMALLOC" + | "PF_NPROC_EXCEEDED" + | "PF_USED_MATH" + | "PF_USER_WORKER" + | "PF_NOFREEZE" + | "PF_KSWAPD" + | "PF_MEMALLOC_NOFS" + | "PF_MEMALLOC_NOIO" + | "PF_LOCAL_THROTTLE" + | "PF_KTHREAD" + | "PF_RANDOMIZE" + | "PF_NO_SETAFFINITY" + | "PF_MCE_EARLY" + | "PF_MEMALLOC_PIN" + | "PF_SUSPEND_TASK" => true, + _ => false, } }); From 3726d147662f0357bb2bbb6b8b255aac1504c725 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 22 Jan 2024 13:37:28 +0100 Subject: [PATCH 3/3] Update crate version to 0.2.153 --- Cargo.toml | 2 +- libc-test/Cargo.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f591205272b9d..b29a475a4d7b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc" -version = "0.2.152" +version = "0.2.153" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index e715a98391fce..a9ae85e857fa5 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libc-test" -version = "0.2.152" +version = "0.2.153" authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" build = "build.rs" @@ -12,7 +12,7 @@ A test crate for the libc crate. [dependencies.libc] path = ".." -version = "0.2.152" +version = "0.2.153" default-features = false [build-dependencies]