diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp index fe79e1908d602..eefa0b326e51b 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp @@ -607,7 +607,13 @@ size_t PageSize() { } void SetThreadName(std::thread &thread, const std::string &name) { - // TODO ? + if (name.size() > 31) + name.resize(31); + zx_status_t s; + if ((s = zx_object_set_property(thread.native_handle(), ZX_PROP_NAME, + name.c_str(), name.size())) != ZX_OK) + Printf("SetThreadName for name %s failed: %s", name.c_str(), + zx_status_get_string(s)); } } // namespace fuzzer