Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Apr 6, 2024

Both __errno_location() and __error() return the same value, so the __error() function can be implemented on the Rust side as __errno_location(). This eliminates the sole use of thread_local in this crate.

@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@bjorn3 bjorn3 force-pushed the dragonfly_no_thread_local branch from 64bd72c to 1ab93fb Compare April 16, 2024 12:26
__error() has been deprecated and return the same value as
__errno_location(). Removing the __error() function eliminates the sole
use of thread_local in this crate.
@bjorn3 bjorn3 force-pushed the dragonfly_no_thread_local branch from 1ab93fb to de76fee Compare April 16, 2024 12:27
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.

Thanks!

@JohnTitor JohnTitor added this pull request to the merge queue Apr 17, 2024
Merged via the queue into rust-lang:main with commit 5b96ddf Apr 17, 2024
@bjorn3 bjorn3 deleted the dragonfly_no_thread_local branch April 17, 2024 12:45
@tgross35
Copy link
Contributor

tgross35 commented Nov 3, 2025

Looks like this never made it to the 0.2 branch. Picking it up now since this helps us avoid some conflicts (unstable feature on a T3 target)

@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 Nov 3, 2025
tgross35 pushed a commit to tgross35/rust-libc that referenced this pull request Nov 3, 2025
__error() has been deprecated and return the same value as
__errno_location(). Removing the __error() function eliminates the sole
use of thread_local in this crate.

(backport <rust-lang#3653>)
(cherry picked from commit de76fee)
[ resolved conflicts in all files and removed the now-unused
  `rustc_dep_of_std` - Trevor ]
github-merge-queue bot pushed a commit that referenced this pull request Nov 4, 2025
__error() has been deprecated and return the same value as
__errno_location(). Removing the __error() function eliminates the sole
use of thread_local in this crate.

(backport <#3653>)
(cherry picked from commit de76fee)
[ resolved conflicts in all files and removed the now-unused
  `rustc_dep_of_std` - Trevor ]
@tgross35 tgross35 mentioned this pull request Nov 4, 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 Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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