Skip to content

Conversation

xingxue-ibm
Copy link
Contributor

Description

AIX defines some errno values as aliases of other errno values under the _ALL_SOURCE macro, but the POSIX standard requires each errno to be unique. This also causes some crates, such as nix, to fail. This PR updates the affected errno values in libc to address the issue.

Sources

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

@collinfunk
Copy link
Contributor

Can confirm this is the case on an AIX 7.3 machine I have access to. EWOULDBLOCK == EAGAIN if _XOPEN_SOURCE_EXTENDED == 1 and ENOTEMPTY == EEXIST if defined _ALL_SOURCE. I'm assuming that _ALL_SOURCE will define _XOPEN_SOURCE_EXTENDED to 1, much like other feature macros.

Therefore, this change looks good to me.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

Thanks @xingxue-ibm for the PR and @collinfunk for reviewing!

I'm assuming you want this in 0.2 so

@rustbot label +stable-nominated

@rustbot rustbot added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jun 28, 2025
@tgross35 tgross35 force-pushed the use-unique-errno-values branch from 5fcc92e to fa6a299 Compare June 28, 2025 23:20
@tgross35 tgross35 enabled auto-merge June 28, 2025 23:20
@tgross35 tgross35 added this pull request to the merge queue Jun 28, 2025
@xingxue-ibm
Copy link
Contributor Author

Thanks so much, @collinfunk and @tgross35! Yes, it will be great if the fix can be included in the stable branch.

Merged via the queue into rust-lang:main with commit 59204ee Jun 29, 2025
50 of 51 checks passed
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Jul 29, 2025
(backport <rust-lang#4507>)
(cherry picked from commit fa6a299)
@tgross35 tgross35 mentioned this pull request Jul 29, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 29, 2025
(backport <#4507>)
(cherry picked from commit fa6a299)
@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 Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix S-waiting-on-review 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.

4 participants