Skip to content

Commit 4809f18

Browse files
committed
[compiler-rt][fuzzer] implements SetThreadName for fuchsia.
1 parent d48d480 commit 4809f18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler-rt/lib/fuzzer/FuzzerUtilFuchsia.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,11 @@ size_t PageSize() {
607607
}
608608

609609
void SetThreadName(std::thread &thread, const std::string &name) {
610-
// TODO ?
610+
if (name.size() > 31) {
611+
name.resize(31);
612+
}
613+
(void)zx_object_set_property(thread.native_handle(), ZX_PROP_NAME,
614+
name.c_str(), name.size());
611615
}
612616

613617
} // namespace fuzzer

0 commit comments

Comments
 (0)