We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c22ea8 commit b8dd441Copy full SHA for b8dd441
std/src/sys/pal/unix/thread.rs
@@ -117,13 +117,15 @@ impl Thread {
117
pub fn set_name(name: &CStr) {
118
const PR_SET_NAME: libc::c_int = 15;
119
unsafe {
120
- libc::prctl(
+ let res = libc::prctl(
121
PR_SET_NAME,
122
name.as_ptr(),
123
0 as libc::c_ulong,
124
125
126
);
127
+ // We have no good way of propagating errors here, but in debug-builds let's check that this actually worked.
128
+ debug_assert_eq!(res, 0);
129
}
130
131
0 commit comments