thread/Util: no ioprio_set() on Android due to seccomp/SIGSYS

This commit is contained in:
Max Kellermann 2018-01-04 19:19:16 +01:00
parent fbdb8b406e
commit 329f9cd9fe
2 changed files with 6 additions and 1 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ ver 0.20.15 (not yet released)
- fix crash when restoring mounts with incompatible database plugin - fix crash when restoring mounts with incompatible database plugin
* Android * Android
- build without Ant - build without Ant
- fix for SIGSYS crash
ver 0.20.14 (2018/01/01) ver 0.20.14 (2018/01/01)
* database * database

View File

@ -38,7 +38,7 @@
#include <windows.h> #include <windows.h>
#endif #endif
#ifdef __linux__ #if defined(__linux__) && !defined(ANDROID)
static int static int
ioprio_set(int which, int who, int ioprio) ioprio_set(int which, int who, int ioprio)
@ -69,7 +69,11 @@ SetThreadIdlePriority()
sched_setscheduler(0, SCHED_IDLE, &sched_param); sched_setscheduler(0, SCHED_IDLE, &sched_param);
#endif #endif
#ifndef ANDROID
/* this system call is forbidden via seccomp on Android 8 and
leads to crash (SIGSYS) */
ioprio_set_idle(); ioprio_set_idle();
#endif
#elif defined(_WIN32) #elif defined(_WIN32)
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_IDLE);