Update relibc constants for Redox compatibility#4990
Open
ChihweiLHBird wants to merge 2 commits intorust-lang:mainfrom
Open
Update relibc constants for Redox compatibility#4990ChihweiLHBird wants to merge 2 commits intorust-lang:mainfrom
ChihweiLHBird wants to merge 2 commits intorust-lang:mainfrom
Conversation
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
d87151d to
a31e504
Compare
jackpot51
approved these changes
Feb 22, 2026
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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) →1030andFIXME(redox): relibcwrapper removedIP_RECVTOS:2→13TCP_KEEPIDLE:1(was same asTCP_NODELAY) →4andFIXME(redox): relibcwrapper removedConstants added from
relibc(were missing):IPV6_JOIN_GROUP = 20IPV6_LEAVE_GROUP = 21Sources
All values sourced from relibc
53cc0e5aed5b586dccdaad51032b15c0b3bf960e:F_DUPFD_CLOEXEC = 1030: https://gitlab.redox-os.org/redox-os/relibc/-/blob/53cc0e5aed5b586dccdaad51032b15c0b3bf960e/src/header/fcntl/mod.rs#L39IP_RECVTOS = 13: https://gitlab.redox-os.org/redox-os/relibc/-/blob/53cc0e5aed5b586dccdaad51032b15c0b3bf960e/src/header/netinet_in/mod.rs#L67IPV6_JOIN_GROUP = 20,IPV6_LEAVE_GROUP = 21: https://gitlab.redox-os.org/redox-os/relibc/-/blob/53cc0e5aed5b586dccdaad51032b15c0b3bf960e/src/header/netinet_in/mod.rs#L103TCP_KEEPIDLE = 4: https://gitlab.redox-os.org/redox-os/relibc/-/blob/53cc0e5aed5b586dccdaad51032b15c0b3bf960e/src/header/netinet_tcp/mod.rs#L12Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI