Skip to content

Conversation

xingxue-ibm
Copy link
Contributor

Description

The AIX signatures for some non-POSIX functions differ from those on platforms like Linux: some arguments are not marked with the const qualifier, even though they are not modified. To be consistent with other platforms, const is added to the Rust declarations.

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

@tgross35
Copy link
Contributor

LGTM after cargo fmt.

Were you able to confirm that these are actually fine to be const, or does AIX actually sometimes requite them to be mut for some reason?

@xingxue-ibm
Copy link
Contributor Author

LGTM after cargo fmt.

Were you able to confirm that these are actually fine to be const, or does AIX actually sometimes requite them to be mut for some reason?

Yes, the AIX team confirmed that there should not be an impact if the arguments are declared with const for these API’s in the RUST code.

@xingxue-ibm
Copy link
Contributor Author

I requested AIX to update these signatures with const in AIX headers to help future porting OSS to AIX.

@tgross35
Copy link
Contributor

Could you just run the formatter here for the style check job (and squash)?

I requested AIX to update these signatures with const in AIX headers to help future porting OSS to AIX.

Great, thank you!

@xingxue-ibm
Copy link
Contributor Author

xingxue-ibm commented Jul 23, 2025

Could you just run the formatter here for the style check job (and squash)?

Sorry, I’ve corrected the formatting.

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.

Thank you!

@tgross35 tgross35 added this pull request to the merge queue Jul 23, 2025
@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jul 23, 2025
Merged via the queue into rust-lang:main with commit 17299d3 Jul 23, 2025
48 of 52 checks passed
@xingxue-ibm
Copy link
Contributor Author

Thank you, @tgross35!

@entd
Copy link

entd commented Jul 25, 2025

Thanks for this work guys.

tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Jul 29, 2025
@tgross35 tgross35 mentioned this pull request Jul 29, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 29, 2025
@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 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