Index: vendor/adb/sysdeps.h --- vendor/adb/sysdeps.h.orig +++ vendor/adb/sysdeps.h @@ -409,6 +409,9 @@ size_t ParseCompleteUTF8(const char* first, const char #include #include #include +#ifdef __OpenBSD__ +#include +#endif #include #include #include @@ -652,6 +655,12 @@ inline int adb_socket_get_local_port(borrowed_fd fd) { static inline int adb_thread_setname(const std::string& name) { #ifdef __APPLE__ return pthread_setname_np(name.c_str()); +#elif defined(__OpenBSD__) + char buf[16]; + strncpy(buf, name.c_str(), sizeof(buf) - 1); + buf[sizeof(buf) - 1] = 0; + pthread_set_name_np(pthread_self(), buf); + return 0; #else // Both bionic and glibc's pthread_setname_np fails rather than truncating long strings. // glibc doesn't have strlcpy, so we have to fake it.