diff options
Diffstat (limited to 'devel/android-tools-simpleperf/files/patch-libcutils_threads.c')
-rw-r--r-- | devel/android-tools-simpleperf/files/patch-libcutils_threads.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/devel/android-tools-simpleperf/files/patch-libcutils_threads.c b/devel/android-tools-simpleperf/files/patch-libcutils_threads.c index 83c53fd60224..eca025017eda 100644 --- a/devel/android-tools-simpleperf/files/patch-libcutils_threads.c +++ b/devel/android-tools-simpleperf/files/patch-libcutils_threads.c @@ -1,21 +1,19 @@ --- libcutils/threads.c.orig 2015-08-12 23:28:08 UTC +++ libcutils/threads.c -@@ -29,6 +29,14 @@ +@@ -29,6 +29,12 @@ #include <unistd.h> #elif defined(_WIN32) #include <windows.h> +#elif defined(__DragonFly__) +#include <unistd.h> +#elif defined(__FreeBSD__) -+#include <sys/param.h> -+#include <sys/thr.h> +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> #endif // No definition needed for Android because we'll just pick up bionic's copy. -@@ -40,6 +48,20 @@ pid_t gettid() { +@@ -40,6 +48,14 @@ pid_t gettid() { return syscall(__NR_gettid); #elif defined(_WIN32) return GetCurrentThreadId(); @@ -24,13 +22,7 @@ +#elif defined(__NetBSD__) + return _lwp_self(); +#elif defined(__FreeBSD__) -+# if __FreeBSD_version > 900030 -+ return pthread_getthreadid_np(); -+# else -+ long lwpid; -+ thr_self(&lwpid); -+ return lwpid; -+# endif ++ return pthread_getthreadid_np(); +#else + return (intptr_t) pthread_self(); #endif |