Skip to content

Conversation

xingxue-ibm
Copy link
Contributor

Description

The request argument of the ioctl() function has type c_int, but the associated constants were mistakenly defined as c_long due to an oversight on my part.

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

@@ -5593,6 +5593,21 @@ fn test_aix(target: &str) {
// values because non-unique values are being used which will
// fail the test when _ALL_SOURCE is defined.
"EWOULDBLOCK" | "ENOTEMPTY" => true,

// These constants are intended for use as the 'int request' argument to 'ioctl()'.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you make this comment FIXME(ctest)? Because if it's an issue that only shows up during tests but not in C, presumably we could do some better validation on our end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you make this comment FIXME(ctest)? Because if it's an issue that only shows up during tests but not in C, presumably we could do some better validation on our end.

Good point! Thanks!

@xingxue-ibm xingxue-ibm force-pushed the fix-ioctl-constants branch from ffd8efe to 3c84eb6 Compare July 26, 2025 14:20
@collinfunk
Copy link
Contributor

I assume this is because BSD and Linux use long for the request argument ioctl, despite POSIX requiring int. AIX follows POSIX and uses int so this is correct.

@tgross35 tgross35 added this pull request to the merge queue Jul 28, 2025
Merged via the queue into rust-lang:main with commit 19addb7 Jul 28, 2025
48 of 52 checks passed
@xingxue-ibm
Copy link
Contributor Author

@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 Jul 28, 2025
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