]> arthur.barton.de Git - netdata.git/blobdiff - src/daemon.c
do not attempt to use SCHED_IDLE when it is not available
[netdata.git] / src / daemon.c
index 6710ddaf7569e8e4b1c6359b8fa8deebdd5a4a2c..bc4614f079063f33d8902f5d52fa259404653900 100644 (file)
@@ -139,6 +139,7 @@ void oom_score_adj(int score) {
 }
 
 int sched_setscheduler_idle(void) {
+#ifdef SCHED_IDLE
     const struct sched_param param = {
         .sched_priority = 0
     };
@@ -150,6 +151,9 @@ int sched_setscheduler_idle(void) {
         info("Adjusted my scheduling priority to IDLE.");
 
     return i;
+#else
+    return -1;
+#endif
 }
 
 int become_daemon(int dont_fork, const char *user)