Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing SO_* values #4242

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- toolchain: beta
os: ubuntu-24.04
runs-on: ${{ matrix.os }}
timeout-minutes: 25
timeout-minutes: 40
env:
TOOLCHAIN: ${{ matrix.toolchain }}
steps:
Expand Down
3 changes: 1 addition & 2 deletions ci/verify-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ test_target() {
no_dist="$2"

RUSTFLAGS="${RUSTFLAGS:-}"

# The basic command that is run each time
cmd="cargo +$rust build --target $target"

Expand Down Expand Up @@ -73,7 +72,7 @@ test_target() {

if [ "$os" = "linux" ]; then
# Test with the equivalent of __USE_TIME_BITS64
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64=1 $cmd --target-dir "target/$target-time64"
fi

# Test again without default features, i.e. without "std"
Expand Down
14 changes: 13 additions & 1 deletion src/unix/linux_like/linux/arch/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,24 @@ const SO_TIMESTAMPING_OLD: c_int = 37;
cfg_if! {
if #[cfg(all(
linux_time_bits64,
any(target_arch = "arm", target_arch = "x86")
any(target_arch = "arm", target_arch = "x86"),
not(any(target_env = "musl", target_env = "ohos"))
))] {
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_NEW;
pub const SO_TIMESTAMPING: c_int = SO_TIMESTAMPING_NEW;
pub const SO_RCVTIMEO: c_int = SO_RCVTIMEO_NEW;
pub const SO_SNDTIMEO: c_int = SO_SNDTIMEO_NEW;
} else if #[cfg(all(
linux_time_bits64,
any(target_arch = "arm", target_arch = "x86"),
any(target_env = "musl", target_env = "ohos")
))] {
pub const SO_TIMESTAMP: c_int = 63;
pub const SO_TIMESTAMPNS: c_int = 64;
pub const SO_TIMESTAMPING: c_int = 65;
pub const SO_RCVTIMEO: c_int = 66;
pub const SO_SNDTIMEO: c_int = 67;
} else {
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_OLD;
pub const SO_TIMESTAMPNS: c_int = SO_TIMESTAMPNS_OLD;
Expand Down Expand Up @@ -114,6 +125,7 @@ cfg_if! {
any(
target_arch = "x86",
target_arch = "x86_64",
target_arch = "arm",
target_arch = "aarch64",
target_arch = "csky",
target_arch = "loongarch64"
Expand Down
5 changes: 5 additions & 0 deletions src/unix/linux_like/linux/arch/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ pub const SO_BINDTOIFINDEX: c_int = 62;
// but CI haven't support them yet.
// Some related consts could be found in b32.rs and b64.rs
const SO_TIMESTAMP_OLD: c_int = 29;
const SO_RCVTIMEO_NEW: c_int = 66;
const SO_SNDTIMEO_NEW: c_int = 67;
const SO_TIMESTAMPNS_OLD: c_int = 35;
const SO_TIMESTAMPING_OLD: c_int = 37;
const SO_TIMESTAMP_NEW: c_int = 63;
const SO_TIMESTAMPNS_NEW: c_int = 64;
const SO_TIMESTAMPING_NEW: c_int = 65;
cfg_if! {
if #[cfg(linux_time_bits64)] {
pub const SO_TIMESTAMP: c_int = SO_TIMESTAMP_NEW;
Expand Down
10 changes: 5 additions & 5 deletions src/unix/linux_like/linux/arch/powerpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ pub const SO_ZEROCOPY: c_int = 60;
pub const SO_TXTIME: c_int = 61;
pub const SCM_TXTIME: c_int = SO_TXTIME;
pub const SO_BINDTOIFINDEX: c_int = 62;
// pub const SO_TIMESTAMP_NEW: c_int = 63;
// pub const SO_TIMESTAMPNS_NEW: c_int = 64;
// pub const SO_TIMESTAMPING_NEW: c_int = 65;
// pub const SO_RCVTIMEO_NEW: c_int = 66;
// pub const SO_SNDTIMEO_NEW: c_int = 67;
const SO_TIMESTAMP_NEW: c_int = 63;
const SO_TIMESTAMPNS_NEW: c_int = 64;
const SO_TIMESTAMPING_NEW: c_int = 65;
const SO_RCVTIMEO_NEW: c_int = 66;
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;
Expand Down
Loading