mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 15:45:06 -05:00
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:
committed by
Miroslav Lichvar
parent
2ddd0ae231
commit
69c6dffd63
2
sys.c
2
sys.c
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user