26 lines
861 B
Plaintext
26 lines
861 B
Plaintext
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 <netinet/tcp.h>
|
|
#include <poll.h>
|
|
#include <pthread.h>
|
|
+#ifdef __OpenBSD__
|
|
+#include <pthread_np.h>
|
|
+#endif
|
|
#include <signal.h>
|
|
#include <stdarg.h>
|
|
#include <stdint.h>
|
|
@@ -652,6 +655,11 @@ 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];
|
|
+ strlcpy(buf, name.c_str(), sizeof(buf));
|
|
+ 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.
|