-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
linux: Use pthread_setname_np
instead of prctl
#100287
Conversation
This function is available on Linux since glibc 2.12, musl 1.1.16, and uClibc 1.0.20. The main advantage over `prctl` is that it properly represents the pointer argument, rather than a multi-purpose `long`, so we're better representing strict provenance (rust-lang#95496).
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ |
Rollup of 11 pull requests Successful merges: - rust-lang#92744 (Check if enum from foreign crate has any non exhaustive variants when attempting a cast) - rust-lang#99110 (Determine match_has_guard from candidates instead of looking up thir table again) - rust-lang#100184 (Stabilize ptr_const_cast) - rust-lang#100192 ( Remove duplicated temporaries creating during box derefs elaboration) - rust-lang#100232 (Do not consider method call receiver as an argument in AST.) - rust-lang#100287 (linux: Use `pthread_setname_np` instead of `prctl`) - rust-lang#100351 (Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed) - rust-lang#100370 (Remove more Clean trait implementations) - rust-lang#100391 (Improve size assertions) - rust-lang#100398 (Improve `-Zhir-stats`) - rust-lang#100403 (Improve error messages when running rustdoc GUI tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
I think this commit breaks the previous behavior of setting thread name. Previously if the thread name exceeded 15+1 characters, it was truncated, but still set.
|
I just brought that up for discussion on Zulip: |
This function is available on Linux since glibc 2.12, musl 1.1.16, and
uClibc 1.0.20. The main advantage over
prctl
is that it properlyrepresents the pointer argument, rather than a multi-purpose
long
,so we're better representing strict provenance (#95496).