From 80e055aafb03cdd9facf717a763e82811439d0c9 Mon Sep 17 00:00:00 2001 From: Andrew Liebenow Date: Tue, 1 Oct 2024 02:21:44 -0500 Subject: [PATCH] Add missing musl utmpx.h constants (backport ) (cherry picked from commit 6cd88a49e7ead33237eed71152ed72e196b95077) --- libc-test/semver/linux-musl.txt | 19 +++++++++++++++++++ src/unix/linux_like/linux/musl/mod.rs | 12 ++++++++++++ 2 files changed, 31 insertions(+) diff --git a/libc-test/semver/linux-musl.txt b/libc-test/semver/linux-musl.txt index bb8dbb2f9834e..d9de3b22d202f 100644 --- a/libc-test/semver/linux-musl.txt +++ b/libc-test/semver/linux-musl.txt @@ -10,25 +10,44 @@ MPOL_DEFAULT MPOL_INTERLEAVE MPOL_LOCAL MPOL_PREFERRED +BOOT_TIME +DEAD_PROCESS Elf32_Chdr Elf64_Chdr +EMPTY +INIT_PROCESS LIO_NOP LIO_NOWAIT LIO_READ LIO_WAIT LIO_WRITE +MPOL_BIND +MPOL_DEFAULT +MPOL_INTERLEAVE +MPOL_LOCAL +MPOL_PREFERRED +LOGIN_PROCESS +MPOL_BIND +MPOL_DEFAULT +MPOL_INTERLEAVE +MPOL_LOCAL +MPOL_PREFERRED +NEW_TIME +OLD_TIME PF_IB PF_MPLS PF_XDP PIDFD_NONBLOCK PR_SET_VMA PR_SET_VMA_ANON_NAME +RUN_LVL RWF_APPEND RWF_DSYNC RWF_HIPRI RWF_NOWAIT RWF_SYNC SOL_XDP +USER_PROCESS XDP_SHARED_UMEM XDP_COPY XDP_ZEROCOPY diff --git a/src/unix/linux_like/linux/musl/mod.rs b/src/unix/linux_like/linux/musl/mod.rs index d102d5de2cfed..72bd335360b8e 100644 --- a/src/unix/linux_like/linux/musl/mod.rs +++ b/src/unix/linux_like/linux/musl/mod.rs @@ -632,6 +632,18 @@ pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT; pub const MS_RMT_MASK: ::c_ulong = 0x02800051; +// include/utmpx.h +pub const EMPTY: ::c_short = 0; +pub const RUN_LVL: ::c_short = 1; +pub const BOOT_TIME: ::c_short = 2; +pub const NEW_TIME: ::c_short = 3; +pub const OLD_TIME: ::c_short = 4; +pub const INIT_PROCESS: ::c_short = 5; +pub const LOGIN_PROCESS: ::c_short = 6; +pub const USER_PROCESS: ::c_short = 7; +pub const DEAD_PROCESS: ::c_short = 8; +// musl does not define ACCOUNTING + pub const SFD_CLOEXEC: ::c_int = 0x080000; pub const NCCS: usize = 32;