commit a1fd268df893059f4213f1cd53c3a6ae55e0abad
Author: q66 <q66@chimera-linux.org>
Date:   Wed Jan 21 13:54:39 2026 +0100

    work around musl ENOSYS memery
    
    Also see the patch in python etc.
    
    maybe we should just patch libc to not be pedantic

diff --git a/src/daemon.c b/src/daemon.c
index c70fbab..a8cf3f3 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -622,13 +622,13 @@ int run_daemon(int argc, char *argv[])
 	setvbuf(stdout, NULL, _IOLBF, 0);
 	setvbuf(stderr, NULL, _IOLBF, 0);
 
-	if (sched_getparam(0, &sp)) {
+	if (syscall(__NR_sched_getparam, 0, &sp) < 0) {
 		perror("sched_getparam");
 		exit(-1);
 	}
 
 	sp.sched_priority = 49;
-	if (sched_setscheduler(0, SCHED_FIFO, &sp)) {
+	if (syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, &sp) < 0) {
 		perror("sched_setscheduler");
 		exit(-1);
 	}
diff --git a/src/keyd.h b/src/keyd.h
index 6890dd5..c5fccce 100644
--- a/src/keyd.h
+++ b/src/keyd.h
@@ -32,6 +32,7 @@
 #include <sched.h>
 #include <sys/mman.h>
 #include <unistd.h>
+#include <syscall.h>
 
 #ifdef __FreeBSD__
 	#include <dev/evdev/input.h>
