https://github.com/MaskRay approved this pull request. This is similar to compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp. Looks good if @adrew0809 can confirm that this fixes the issue. https://github.com/llvm/llvm-project/pull/152947