From d05a44c3893a90e7489f1d9025445468c22c32bd 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.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.txt b/libc-test/semver/linux-gnu.txt index 83dd825584cd0..048fc2fd9b578 100644 --- a/libc-test/semver/linux-gnu.txt +++ b/libc-test/semver/linux-gnu.txt @@ -412,6 +412,8 @@ SOL_RAW SOL_RDS SOL_RXRPC SOL_XDP +SO_BUSY_POLL_BUDGET +SO_PREFER_BUSY_POLL STATX_ALL STATX_ATIME STATX_ATTR_APPEND 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(