Skip to content

Commit 4fd5d03

Browse files
committed
keyd: add patch for using sched_getparam syscall directly (for musl)
1 parent 354625b commit 4fd5d03

2 files changed

Lines changed: 43 additions & 1 deletion

File tree

srcpkgs/keyd/patches/sched.patch

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
commit a1fd268df893059f4213f1cd53c3a6ae55e0abad
2+
Author: q66 <q66@chimera-linux.org>
3+
Date: Wed Jan 21 13:54:39 2026 +0100
4+
5+
work around musl ENOSYS memery
6+
7+
Also see the patch in python etc.
8+
9+
maybe we should just patch libc to not be pedantic
10+
11+
diff --git a/src/daemon.c b/src/daemon.c
12+
index c70fbab..a8cf3f3 100644
13+
--- a/src/daemon.c
14+
+++ b/src/daemon.c
15+
@@ -622,13 +622,13 @@ int run_daemon(int argc, char *argv[])
16+
setvbuf(stdout, NULL, _IOLBF, 0);
17+
setvbuf(stderr, NULL, _IOLBF, 0);
18+
19+
- if (sched_getparam(0, &sp)) {
20+
+ if (syscall(__NR_sched_getparam, 0, &sp) < 0) {
21+
perror("sched_getparam");
22+
exit(-1);
23+
}
24+
25+
sp.sched_priority = 49;
26+
- if (sched_setscheduler(0, SCHED_FIFO, &sp)) {
27+
+ if (syscall(__NR_sched_setscheduler, 0, SCHED_FIFO, &sp) < 0) {
28+
perror("sched_setscheduler");
29+
exit(-1);
30+
}
31+
diff --git a/src/keyd.h b/src/keyd.h
32+
index 6890dd5..c5fccce 100644
33+
--- a/src/keyd.h
34+
+++ b/src/keyd.h
35+
@@ -32,6 +32,7 @@
36+
#include <sched.h>
37+
#include <sys/mman.h>
38+
#include <unistd.h>
39+
+#include <syscall.h>
40+
41+
#ifdef __FreeBSD__
42+
#include <dev/evdev/input.h>

srcpkgs/keyd/template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Template file for 'keyd'
22
pkgname=keyd
33
version=2.6.0
4-
revision=1
4+
revision=2
55
build_style=gnu-makefile
66
make_use_env=yes
77
short_desc="Key remapping daemon for linux"

0 commit comments

Comments
 (0)