Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 1 | From 04e8a611e958f0da1ccac61acae3a6f1a5168b20 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
| 3 | Date: Fri, 13 Jul 2018 18:08:14 +0800 |
| 4 | Subject: [PATCH] support musl |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 9 | --- |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 10 | mozglue/misc/TimeStamp_darwin.cpp | 1 - |
| 11 | mozglue/misc/TimeStamp_posix.cpp | 1 - |
| 12 | nsprpub/pr/src/misc/prsystem.c | 1 - |
| 13 | python/psutil/psutil/_psutil_bsd.c | 1 - |
| 14 | python/psutil/psutil/_psutil_osx.c | 1 - |
| 15 | python/psutil/psutil/arch/bsd/process_info.c | 1 - |
| 16 | python/psutil/psutil/arch/osx/process_info.c | 1 - |
| 17 | 9 files changed, 3 insertions(+), 12 deletions(-) |
| 18 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 19 | --- a/mozglue/misc/TimeStamp_darwin.cpp |
| 20 | +++ b/mozglue/misc/TimeStamp_darwin.cpp |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 21 | @@ -19,7 +19,6 @@ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 22 | |
| 23 | #include <mach/mach_time.h> |
| 24 | #include <sys/time.h> |
| 25 | -#include <sys/sysctl.h> |
| 26 | #include <time.h> |
| 27 | #include <unistd.h> |
| 28 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 29 | --- a/mozglue/misc/TimeStamp_posix.cpp |
| 30 | +++ b/mozglue/misc/TimeStamp_posix.cpp |
| 31 | @@ -21,7 +21,6 @@ |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 32 | #if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \ |
| 33 | defined(__OpenBSD__) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 34 | #include <sys/param.h> |
| 35 | -#include <sys/sysctl.h> |
| 36 | #endif |
| 37 | |
| 38 | #if defined(__DragonFly__) || defined(__FreeBSD__) |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 39 | --- a/nsprpub/pr/src/misc/prsystem.c |
| 40 | +++ b/nsprpub/pr/src/misc/prsystem.c |
| 41 | @@ -27,7 +27,6 @@ |
| 42 | || defined(OPENBSD) || defined(DRAGONFLY) || defined(DARWIN) |
| 43 | #define _PR_HAVE_SYSCTL |
| 44 | #include <sys/param.h> |
| 45 | -#include <sys/sysctl.h> |
| 46 | #endif |
| 47 | |
| 48 | #if defined(DARWIN) |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 49 | --- a/third_party/python/psutil/psutil/_psutil_bsd.c |
| 50 | +++ b/third_party/python/psutil/psutil/_psutil_bsd.c |
| 51 | @@ -29,7 +29,6 @@ |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 52 | #include <paths.h> |
| 53 | #include <sys/types.h> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 54 | #include <sys/param.h> |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 55 | -#include <sys/sysctl.h> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 56 | #include <sys/user.h> |
| 57 | #include <sys/proc.h> |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 58 | #include <sys/file.h> |
| 59 | --- a/third_party/python/psutil/psutil/_psutil_osx.c |
| 60 | +++ b/third_party/python/psutil/psutil/_psutil_osx.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 61 | @@ -13,7 +13,6 @@ |
| 62 | #include <stdlib.h> |
| 63 | #include <stdio.h> |
| 64 | #include <utmpx.h> |
| 65 | -#include <sys/sysctl.h> |
| 66 | #include <sys/vmmeter.h> |
| 67 | #include <libproc.h> |
| 68 | #include <sys/proc_info.h> |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 69 | --- a/third_party/python/psutil/psutil/arch/osx/process_info.c |
| 70 | +++ b/third_party/python/psutil/psutil/arch/osx/process_info.c |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 71 | @@ -16,7 +16,6 @@ |
| 72 | #include <stdlib.h> |
| 73 | #include <stdio.h> |
| 74 | #include <signal.h> |
| 75 | -#include <sys/sysctl.h> |
| 76 | #include <libproc.h> |
| 77 | |
| 78 | #include "process_info.h" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame^] | 79 | --- a/memory/build/Mutex.h |
| 80 | +++ b/memory/build/Mutex.h |
| 81 | @@ -42,7 +42,7 @@ struct Mutex { |
| 82 | if (pthread_mutexattr_init(&attr) != 0) { |
| 83 | return false; |
| 84 | } |
| 85 | - pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); |
| 86 | + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_STALLED); |
| 87 | if (pthread_mutex_init(&mMutex, &attr) != 0) { |
| 88 | pthread_mutexattr_destroy(&attr); |
| 89 | return false; |
| 90 | @@ -102,7 +102,7 @@ typedef Mutex StaticMutex; |
| 91 | |
| 92 | #if defined(XP_DARWIN) |
| 93 | #define STATIC_MUTEX_INIT OS_SPINLOCK_INIT |
| 94 | -#elif defined(XP_LINUX) && !defined(ANDROID) |
| 95 | +#elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__) |
| 96 | #define STATIC_MUTEX_INIT PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP |
| 97 | #else |
| 98 | #define STATIC_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER |