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

Dragonfly: expose __errno_location() rather than define __error(). #1875

Merged
merged 2 commits into from
Sep 2, 2020
Merged

Dragonfly: expose __errno_location() rather than define __error(). #1875

merged 2 commits into from
Sep 2, 2020

Conversation

cmusser
Copy link
Contributor

@cmusser cmusser commented Aug 23, 2020

This takes advantage of a recent addition to DragonFly that makes it possible to access errno (which is thread-local) without any dependence on the thread_local Rust feature. I tested it out by using it in the Nix crate. Nix had a C language shim, which I removed and replaced by using this modified version of libc.

Expose __errno_location() (introduced in DragonFlyBSD 5.8), which
returns the current thread's errno value. This is similar to Linux
and avoids having a separate module that defines both errno (which
depends on the thread_local feature) and an __error() function.
@JohnTitor
Copy link
Member

I think this will break the backward compatibility, right? Then I'd like to avoid just removing it but add a deprecation note for a while then drop it.

@cmusser
Copy link
Contributor Author

cmusser commented Aug 24, 2020

Good point. I suspect not many people use it, but no easy way to tell. I added the errno module back, along with its reference. The function has a deprecation warning now.

@cmusser
Copy link
Contributor Author

cmusser commented Aug 25, 2020

Do these changes look acceptable?

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.

Sorry for the delay, it looks good now! Thanks <3

@JohnTitor JohnTitor merged commit 75ab4a0 into rust-lang:master Sep 2, 2020
@cmusser
Copy link
Contributor Author

cmusser commented Sep 4, 2020

awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants