Skip to content

Comments

Update relibc constants for Redox compatibility#4990

Open
ChihweiLHBird wants to merge 2 commits intorust-lang:mainfrom
ChihweiLHBird:zhiwei/update-relibc-constants
Open

Update relibc constants for Redox compatibility#4990
ChihweiLHBird wants to merge 2 commits intorust-lang:mainfrom
ChihweiLHBird:zhiwei/update-relibc-constants

Conversation

@ChihweiLHBird
Copy link

@ChihweiLHBird ChihweiLHBird commented Feb 22, 2026

Description

Fix incorrect placeholder values and add missing constants for Redox in src/unix/redox/mod.rs, verified against relibc @ 53cc0e5a.

Values corrected (were wrong Linux/placeholder values):

  • F_DUPFD_CLOEXEC: crate::F_DUPFD (= 0) → 1030 and FIXME(redox): relibc wrapper removed
  • IP_RECVTOS: 213
  • TCP_KEEPIDLE: 1 (was same as TCP_NODELAY) → 4 and FIXME(redox): relibc wrapper removed

Constants added from relibc (were missing):

  • IPV6_JOIN_GROUP = 20
  • IPV6_LEAVE_GROUP = 21

Sources

All values sourced from relibc 53cc0e5aed5b586dccdaad51032b15c0b3bf960e:

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
@ChihweiLHBird ChihweiLHBird force-pushed the zhiwei/update-relibc-constants branch from d87151d to a31e504 Compare February 22, 2026 02:49
@ChihweiLHBird ChihweiLHBird marked this pull request as ready for review February 22, 2026 04:17
Copilot AI review requested due to automatic review settings February 22, 2026 04:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Redox platform constants in src/unix/redox/mod.rs to match the actual values defined in relibc, replacing incorrect Linux placeholder values. Redox is a Unix-like operating system written in Rust that uses relibc instead of glibc. The changes ensure that the libc crate provides correct constant values for Redox, which is critical for proper system call behavior.

Changes:

  • Corrected three existing constants that had wrong placeholder values (F_DUPFD_CLOEXEC, IP_RECVTOS, TCP_KEEPIDLE)
  • Added two new IPV6 constants (IPV6_JOIN_GROUP, IPV6_LEAVE_GROUP) as aliases for existing membership constants
  • Removed FIXME comments for corrected constants that now have verified relibc values

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/unix/redox/mod.rs Corrected F_DUPFD_CLOEXEC from 0 to 1030, IP_RECVTOS from 2 to 13, TCP_KEEPIDLE from 1 to 4, and added IPV6_JOIN_GROUP (20) and IPV6_LEAVE_GROUP (21) constants with FIXME comments removed
libc-test/semver/redox.txt Added three new public constants to semver tracking: F_DUPFD_CLOEXEC, IPV6_JOIN_GROUP, and IPV6_LEAVE_GROUP

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants