diff --git a/libc-test/build.rs b/libc-test/build.rs index a384cddfb71d..9db76e35b223 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2003,9 +2003,9 @@ fn test_android(target: &str) { | "PF_IO_WORKER" | "PF_WQ_WORKER" | "PF_FORKNOEXEC" + | "PF_MCE_PROCESS" | "PF_SUPERPRIV" | "PF_DUMPCORE" - | "PF_MCE_PROCESS" | "PF_SIGNALED" | "PF_MEMALLOC" | "PF_NPROC_EXCEEDED" @@ -2021,6 +2021,7 @@ fn test_android(target: &str) { | "PF_NO_SETAFFINITY" | "PF_MCE_EARLY" | "PF_MEMALLOC_PIN" + | "PF_BLOCK_TS" | "PF_SUSPEND_TASK" => true, _ => false, @@ -4240,7 +4241,9 @@ fn test_linux(target: &str) { | "PF_RANDOMIZE" | "PF_NO_SETAFFINITY" | "PF_MCE_EARLY" - | "PF_MEMALLOC_PIN" => true, + | "PF_MEMALLOC_PIN" + | "PF_BLOCK_TS" + | "PF_SUSPEND_TASK" => true, // FIXME: Requires >= 6.9 kernel headers. "EPIOCSPARAMS" diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 0a958b4f6b4c..0f267bdc5836 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -5693,6 +5693,14 @@ 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_BLOCK_TS: c_int = 0x20000000; +pub const PF_SUSPEND_TASK: c_int = PF_SUSPEND_TASK_UINT as _; +// The used value is the highest possible bit fitting on 32 bits, so directly +// defining it as a signed integer causes the compiler to report an overflow. +// Use instead a private intermediary that assuringly has the correct type and +// cast it where necessary to the wanted final type, which preserves the +// desired information as-is in terms of integer representation. +const PF_SUSPEND_TASK_UINT: c_uint = 0x80000000; pub const CSIGNAL: c_int = 0x000000ff;