Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 763a6714 authored by Christopher N. Hesse's avatar Christopher N. Hesse Committed by Michael Bestas
Browse files

libcutils: Fix thread ID on macOS

macOS 10.12 / Xcode 8 actively prohibit the syscall(2)
usage.

Change-Id: I91ff16600a76e97d0b9b5db7e8905b969fb3482f
parent 01bc8f2f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -80,7 +80,9 @@ static thread_id GetThreadId() {
#if defined(__BIONIC__)
  return gettid();
#elif defined(__APPLE__)
  return syscall(SYS_thread_selfid);
  uint64_t tid;
  pthread_threadid_np(NULL, &tid);
  return tid;
#elif defined(__linux__)
  return syscall(__NR_gettid);
#elif defined(_WIN32)
+3 −1
Original line number Diff line number Diff line
@@ -35,7 +35,9 @@
#ifndef __ANDROID__
pid_t gettid() {
#if defined(__APPLE__)
  return syscall(SYS_thread_selfid);
  uint64_t tid;
  pthread_threadid_np(NULL, &tid);
  return tid;
#elif defined(__linux__)
  return syscall(__NR_gettid);
#elif defined(_WIN32)