]> git.lizzy.rs Git - rust.git/commit
Truncate thread names on Linux and Apple targets
authorJosh Stone <jistone@redhat.com>
Sat, 22 Oct 2022 00:44:35 +0000 (17:44 -0700)
committerJosh Stone <jistone@redhat.com>
Sat, 22 Oct 2022 00:44:35 +0000 (17:44 -0700)
commit7280f3d28aa139cec0c75072a3e66294b7f99b59
treee70a206bd8325936ae51c36d28f54ae5c4029435
parent57e2c06a8df3187980801962015a88657abd033d
Truncate thread names on Linux and Apple targets

These targets have system limits on the thread names, 16 and 64 bytes
respectively, and `pthread_setname_np` returns an error if the name is
longer. However, we're not in a context that can propagate errors when
we call this, and we used to implicitly truncate on Linux with `prctl`,
so now we manually truncate these names ahead of time.
library/std/src/sys/unix/thread.rs