Skip to content

Commit b3884fb

Browse files
committed
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 <[email protected]>
1 parent 57dfd5b commit b3884fb

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

libc-test/build.rs

+6
Original file line numberDiff line numberDiff line change
@@ -3964,6 +3964,12 @@ fn test_linux(target: &str) {
39643964
if loongarch64 && (name == "MFD_NOEXEC_SEAL" || name == "MFD_EXEC") {
39653965
return true;
39663966
}
3967+
// FIXME(musl): Requires musl >= 1.2
3968+
if name == "SO_PREFER_BUSY_POLL"
3969+
|| name == "SO_BUSY_POLL_BUDGET"
3970+
{
3971+
return true;
3972+
}
39673973
}
39683974
match name {
39693975
// These constants are not available if gnu headers have been included

libc-test/semver/linux.txt

+2
Original file line numberDiff line numberDiff line change
@@ -2895,6 +2895,7 @@ SOL_X25
28952895
SOMAXCONN
28962896
SO_BINDTODEVICE
28972897
SO_BUSY_POLL
2898+
SO_BUSY_POLL_BUDGET
28982899
SO_DOMAIN
28992900
SO_EE_OFFENDER
29002901
SO_EE_ORIGIN_ICMP
@@ -2914,6 +2915,7 @@ SO_PASSSEC
29142915
SO_PEEK_OFF
29152916
SO_PEERCRED
29162917
SO_PEERSEC
2918+
SO_PREFER_BUSY_POLL
29172919
SO_RCVBUFFORCE
29182920
SO_REUSEPORT
29192921
SO_RXQ_OVFL

src/unix/linux_like/linux/arch/generic/mod.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ cfg_if! {
102102
target_arch = "csky",
103103
target_arch = "loongarch64"
104104
),
105+
// FIXME(musl):
106+
// Musl hardcodes the SO_* constants instead
107+
// of inheriting them from the kernel headers.
108+
// For new constants you might need consider updating
109+
// musl in the CI as well.
105110
not(any(target_env = "musl", target_env = "ohos"))
106111
))] {
107112
pub const SO_TIMESTAMP_NEW: c_int = 63;
@@ -112,8 +117,8 @@ cfg_if! {
112117
pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
113118
}
114119
}
115-
// pub const SO_PREFER_BUSY_POLL: c_int = 69;
116-
// pub const SO_BUSY_POLL_BUDGET: c_int = 70;
120+
pub const SO_PREFER_BUSY_POLL: c_int = 69;
121+
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
117122

118123
cfg_if! {
119124
if #[cfg(any(

src/unix/linux_like/linux/arch/mips/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ pub const SO_TIMESTAMPING: c_int = 37;
102102
// pub const SO_RCVTIMEO_NEW: c_int = 66;
103103
// pub const SO_SNDTIMEO_NEW: c_int = 67;
104104
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
105-
// pub const SO_PREFER_BUSY_POLL: c_int = 69;
106-
// pub const SO_BUSY_POLL_BUDGET: c_int = 70;
105+
pub const SO_PREFER_BUSY_POLL: c_int = 69;
106+
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
107107

108108
pub const FICLONE: c_ulong = 0x80049409;
109109
pub const FICLONERANGE: c_ulong = 0x8020940D;

src/unix/linux_like/linux/arch/powerpc/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ pub const SO_BINDTOIFINDEX: c_int = 62;
8484
// pub const SO_RCVTIMEO_NEW: c_int = 66;
8585
// pub const SO_SNDTIMEO_NEW: c_int = 67;
8686
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68;
87-
// pub const SO_PREFER_BUSY_POLL: c_int = 69;
88-
// pub const SO_BUSY_POLL_BUDGET: c_int = 70;
87+
pub const SO_PREFER_BUSY_POLL: c_int = 69;
88+
pub const SO_BUSY_POLL_BUDGET: c_int = 70;
8989

9090
pub const FICLONE: c_ulong = 0x80049409;
9191
pub const FICLONERANGE: c_ulong = 0x8020940D;

src/unix/linux_like/linux/arch/sparc/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ pub const SO_TIMESTAMPING: c_int = 0x0023;
9494
// pub const SO_RCVTIMEO_NEW: c_int = 0x0044;
9595
// pub const SO_SNDTIMEO_NEW: c_int = 0x0045;
9696
// pub const SO_DETACH_REUSEPORT_BPF: c_int = 0x0047;
97-
// pub const SO_PREFER_BUSY_POLL: c_int = 0x0048;
98-
// pub const SO_BUSY_POLL_BUDGET: c_int = 0x0049;
97+
pub const SO_PREFER_BUSY_POLL: c_int = 0x0048;
98+
pub const SO_BUSY_POLL_BUDGET: c_int = 0x0049;
9999

100100
// Defined in unix/linux_like/mod.rs
101101
// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP;

0 commit comments

Comments
 (0)