Skip to content

Commit 7d6f784

Browse files
committed
Android does not yet have pthread_getname_np in the NDK.
1 parent ee9ad62 commit 7d6f784

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/percetto.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,15 @@ static const char* TryGetProcessExeName(char* buffer, size_t buffer_size) {
153153

154154
static const char* TryGetThreadName(char* buffer, size_t buffer_size) {
155155
pthread_t thread = pthread_self();
156+
#if defined(__ANDROID__)
157+
// pthread_getname_np not yet supported in Android NDK
158+
return NULL;
159+
#else
156160
int result = pthread_getname_np(thread, buffer, buffer_size);
157161
if (result != 0)
158162
return NULL;
159163
return buffer;
164+
#endif
160165
}
161166

162167
static uint64_t GetTrackUuid(uint64_t trackid) {

0 commit comments

Comments
 (0)