Description
pthread_setname_np
on macOS returns an integer success code: https://github.com/apple-oss-distributions/libpthread/blob/cf9e1c7e611440e511af230905be2cfefc5c6121/include/pthread/pthread.h#L509-L510
Unfortunately, the miri shim for it returns void:
miri/src/shims/unix/macos/foreign_items.rs
Lines 176 to 185 in c3d67d4
This probably happened because the manpage on apple tragically has the same mistake: https://github.com/apple-oss-distributions/libpthread/blob/cf9e1c7e611440e511af230905be2cfefc5c6121/man/pthread_setname_np.3#L35
But the function truly does return int: https://github.com/apple-oss-distributions/libpthread/blob/cf9e1c7e611440e511af230905be2cfefc5c6121/src/pthread.c#L1140-L1163
This leads to false positives for UB in libstd's tests: https://github.com/rust-lang/miri-test-libstd/actions/runs/3342425264/jobs/5534636230#step:5:723