summaryrefslogtreecommitdiff
path: root/src/thread
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-01-04 19:19:16 +0100
committerMax Kellermann <max@musicpd.org>2018-01-04 19:33:14 +0100
commit329f9cd9fe4d41afa2986dbf358339b7a48d044b (patch)
treef064ddd01d1e53de50bd1cd2847f90e40a84e6b9 /src/thread
parentfbdb8b406e79d282ed0c5b7fde723fcfbde43d28 (diff)
thread/Util: no ioprio_set() on Android due to seccomp/SIGSYS
Diffstat (limited to 'src/thread')
-rw-r--r--src/thread/Util.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/thread/Util.cxx b/src/thread/Util.cxx
index 6213d9777..c4c93f82e 100644
--- a/src/thread/Util.cxx
+++ b/src/thread/Util.cxx
@@ -38,7 +38,7 @@
#include <windows.h>
#endif
-#ifdef __linux__
+#if defined(__linux__) && !defined(ANDROID)
static int
ioprio_set(int which, int who, int ioprio)
@@ -69,7 +69,11 @@ SetThreadIdlePriority()
sched_setscheduler(0, SCHED_IDLE, &sched_param);
#endif
+#ifndef ANDROID
+ /* this system call is forbidden via seccomp on Android 8 and
+ leads to crash (SIGSYS) */
ioprio_set_idle();
+#endif
#elif defined(_WIN32)
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);