package/musl: Make scheduler functions Linux-compatible
authorstefan.nickl@gmail.com <stefan.nickl@gmail.com>
Tue, 14 May 2019 17:31:26 +0000 (19:31 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sun, 27 Oct 2019 18:27:36 +0000 (19:27 +0100)
commit0437884e2dd1d321f366c14999ca49c1b74b7286
tree66eda066406cee725f2fd7fa407337920b1c6524
parenta5b5a725536d592fd6514e359115321a4f07e8e2
package/musl: Make scheduler functions Linux-compatible

The POSIX functions sched_getscheduler(), sched_setscheduler(),
sched_getparam(), sched_setparam() are technically not correctly
implemented by the Linux syscalls of the same name, because what the
kernel calls a PID and what POSIX calls a PID isn't truly the same,
resulting in somewhat different semantics as to what these functions
exactly apply to.
Details: https://sourceware.org/bugzilla/show_bug.cgi?id=14829

Since the musl developers put a high premium on POSIX compliance, they
deliberately implement these functions to return -ENOSYS instead of
relaying them to the respective Linux syscalls as glibc/uClibc do.

Unfortunally this breaks virtually all Linux programs using these
functions under musl. For example running 'chrt -p 1' fails with
'Function not implemented' on a musl-libc based system.
In particular, it affects embedded systems using these interfaces
for scheduling real-time processes.

As it seems unfeasible to fix all affected programs to manually use
syscall wrappers instead of the libc functions, make musl behave the
Linux way.

Signed-off-by: Stefan Nickl <Stefan.Nickl@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/musl/0002-package-musl-Make-scheduler-functions-Linux-compatib.patch [new file with mode: 0644]