Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libc specific type for architecture specific ioctl defines on Linux. #2550

Merged
merged 1 commit into from Nov 18, 2021

Conversation

de-vri-es
Copy link
Contributor

@de-vri-es de-vri-es commented Nov 17, 2021

This PR should fix the type change of some ioctl constants on Linux introduced by #2530.

It does this by adding a #[doc(hidden)] type called Ioctl, which is defined in libc specific modules and used in arch specific modules.

However, when doing this I noticed that when I added TCGETS2, TCSETS2, ... in #2508, I unconditionally used c_ulong. This is inconsistent with the other ioctl constants for musl and uclibc. This PR also changes those to use the libc specific types. However, PR #2508 has already been released in 0.2.107, so technically that is also a semver incompatible change. The impact is limited to new constants introduced in the last release, and only on musl and uclibc targets.

So what is more important here? Consistency in the type of ioctl constants, or being very strict with backwards compatibility? If it is the latter, I'll revert TCGETS2 etc to c_ulong for this PR.

@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

@de-vri-es
Copy link
Contributor Author

de-vri-es commented Nov 17, 2021

Adjusted the definition now to be pub(crate) when cfg(doc) is enabled. This ensures that the documentation says c_ulong /c_int instead of Ioctl with a broken link.

Since cfg(doc) is newer than pub(crate), this shouldn't even break doc generation on older versions of rust.

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.

The latest version was released 12 days ago, we could assume the impact of breaking changes is quite small (, or even nothing if you don't depend on that). I think it's a reasonable trade-off so am going to r+. Thanks for the nice cleanup!

@JohnTitor
Copy link
Member

r? @JohnTitor @bors r+

@bors
Copy link
Contributor

bors commented Nov 18, 2021

📌 Commit 7c95819 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Nov 18, 2021

⌛ Testing commit 7c95819 with merge 8802703...

@bors
Copy link
Contributor

bors commented Nov 18, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: JohnTitor
Pushing 8802703 to master...

@bors bors merged commit 8802703 into rust-lang:master Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants