Skip to content

redox: add makedev, major, minor, and fix dev_t#4928

Merged
JohnTitor merged 1 commit intorust-lang:mainfrom
redox-os:redox-dev-t
Jan 17, 2026
Merged

redox: add makedev, major, minor, and fix dev_t#4928
JohnTitor merged 1 commit intorust-lang:mainfrom
redox-os:redox-dev-t

Conversation

@jackpot51
Copy link
Contributor

Description

This adds the makedev, major, and minor functions and fixes the type of dev_t on Redox. These functions are defines in the Redox libc, and are identical to the Linux implementations.

Sources

makedev, major, and minor are defined here: https://gitlab.redox-os.org/redox-os/relibc/-/blob/master/include/sys/sysmacros.h?ref_type=heads. These definitions are directly from musl, which matches the const fns in the libc crate.

The type of dev_t can be seen here: https://gitlab.redox-os.org/redox-os/relibc/-/blob/master/src/platform/types.rs?ref_type=heads#L66. It was recently adjusted to fix a discrepancy between 32-bit and 64-bit Redox systems.

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

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Thanks!

@JohnTitor JohnTitor added this pull request to the merge queue Jan 17, 2026
Merged via the queue into rust-lang:main with commit 76e737e Jan 17, 2026
50 of 51 checks passed
@jackpot51
Copy link
Contributor Author

Can this be backported to 0.2 and released?

@JohnTitor
Copy link
Member

Sure!

@JohnTitor JohnTitor added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jan 17, 2026
@jackpot51 jackpot51 deleted the redox-dev-t branch January 19, 2026 16:22
@jackpot51 jackpot51 restored the redox-dev-t branch January 19, 2026 17:17
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Feb 9, 2026
@tgross35 tgross35 mentioned this pull request Feb 9, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 9, 2026
(backport <#4928>)
(cherry picked from commit 76e737e)
@tgross35 tgross35 added stable-applied This PR has been cherry-picked to libc's stable release branch and removed stable-nominated This PR should be considered for cherry-pick to libc's stable release branch labels Feb 9, 2026
@xtqqczze
Copy link
Contributor

Looks like the backport caused breakage with rustix: uutils/coreutils#10871, uutils/coreutils#10844

@tgross35
Copy link
Contributor

tgross35 commented Feb 11, 2026

That's to be expected; we need to update when the upstream platform changes, and it would be unsound to continue using the definition from before this PR. Adding a note in the changelog #4967.

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

Labels

O-redox O-unix stable-applied This PR has been cherry-picked to libc's stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants