[compiler-rt] [compiler-rt][Fuzzer] SetThreadName fuchsia version. (PR #77227)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 6 23:04:48 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: David CARLIER (devnexen)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/77227.diff
1 Files Affected:
- (modified) compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp (+2-1)
``````````diff
diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
index cfb81cd3f780bb..373f750b8a32d3 100644
--- a/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp
@@ -20,6 +20,7 @@
#include <fcntl.h>
#include <lib/fdio/fdio.h>
#include <lib/fdio/spawn.h>
+#include <pthread.h>
#include <string>
#include <sys/select.h>
#include <thread>
@@ -606,7 +607,7 @@ size_t PageSize() {
}
void SetThreadName(std::thread &thread, const std::string &name) {
- // TODO ?
+ (void)pthread_setname_np(thread.native_handle(), name.c_str());
}
} // namespace fuzzer
``````````
</details>
https://github.com/llvm/llvm-project/pull/77227
More information about the llvm-commits
mailing list