sys_linux: use pthread_setschedparam instead of sched_setscheduler

Fix an issue with Linux and musl libc where sched_setscheduler is not
implemented. It seems that pthread_setschedparam is more widely
supported across different C libraries and OSs. For our use case, it
should make no difference which call is used.
This commit is contained in:
Stefan R. Filipek
2019-04-04 19:12:39 -04:00
committed by Miroslav Lichvar
parent 2ddd0ae231
commit 69c6dffd63
3 changed files with 18 additions and 11 deletions

2
sys.c
View File

@@ -124,7 +124,7 @@ void SYS_EnableSystemCallFilter(int level)
void SYS_SetScheduler(int SchedPriority)
{
#if defined(LINUX) && defined(HAVE_SCHED_SETSCHEDULER)
#if defined(LINUX) && defined(HAVE_PTHREAD_SETSCHEDPARAM)
SYS_Linux_SetScheduler(SchedPriority);
#elif defined(MACOSX)
SYS_MacOSX_SetScheduler(SchedPriority);