From 329f9cd9fe4d41afa2986dbf358339b7a48d044b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 4 Jan 2018 19:19:16 +0100 Subject: [PATCH] thread/Util: no ioprio_set() on Android due to seccomp/SIGSYS --- NEWS | 1 + src/thread/Util.cxx | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a6532fe62..e87043daa 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ ver 0.20.15 (not yet released) - fix crash when restoring mounts with incompatible database plugin * Android - build without Ant + - fix for SIGSYS crash ver 0.20.14 (2018/01/01) * database 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 #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);