From 8ddba26cedd394498d91bf15dea848daabb249b7 Mon Sep 17 00:00:00 2001 From: Pedro Tammela Date: Thu, 21 Nov 2024 13:06:04 -0300 Subject: [PATCH] Add SO_PREFER_BUSY_POLL and SO_BUSY_POLL_BUDGET Remove the comment of these socket options. Reference: https://elixir.bootlin.com/linux/latest/source/include/uapi/asm-generic/socket.h Note, musl hardcodes 'SO_*' constants instead of inheriting them from the OS. Signed-off-by: Pedro Tammela --- libc-test/semver/linux-gnu-x86_64.txt | 2 ++ src/unix/linux_like/linux/arch/generic/mod.rs | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libc-test/semver/linux-gnu-x86_64.txt b/libc-test/semver/linux-gnu-x86_64.txt index 604f7d845e7b7..29ad635e68ae9 100644 --- a/libc-test/semver/linux-gnu-x86_64.txt +++ b/libc-test/semver/linux-gnu-x86_64.txt @@ -22,6 +22,8 @@ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP PTRACE_GET_RSEQ_CONFIGURATION PTRACE_SYSEMU PTRACE_SYSEMU_SINGLESTEP +SO_BUSY_POLL_BUDGET +SO_PREFER_BUSY_POLL _libc_fpstate flock64 getcontext diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs index 3e7d3a1117d52..fda36264a3e14 100644 --- a/src/unix/linux_like/linux/arch/generic/mod.rs +++ b/src/unix/linux_like/linux/arch/generic/mod.rs @@ -102,6 +102,11 @@ cfg_if! { target_arch = "csky", target_arch = "loongarch64" ), + // FIXME(musl): + // Musl hardcodes the SO_* constants instead + // of inheriting them from the kernel headers. + // For new constants you might need consider updating + // musl in the CI as well. not(any(target_env = "musl", target_env = "ohos")) ))] { pub const SO_TIMESTAMP_NEW: c_int = 63; @@ -110,10 +115,10 @@ cfg_if! { pub const SO_RCVTIMEO_NEW: c_int = 66; pub const SO_SNDTIMEO_NEW: c_int = 67; pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; + pub const SO_PREFER_BUSY_POLL: c_int = 69; + pub const SO_BUSY_POLL_BUDGET: c_int = 70; } } -// pub const SO_PREFER_BUSY_POLL: c_int = 69; -// pub const SO_BUSY_POLL_BUDGET: c_int = 70; cfg_if! { if #[cfg(any(