zig icon indicating copy to clipboard operation
zig copied to clipboard

std.os.linux is missing sched_setscheduler and related calls.

Open curuvar opened this issue 10 months ago • 1 comments

Zig Version

0.12.0-dev.3666+a2b834e8c

Steps to Reproduce and Observed Behavior

std.os.linux (and std.posix) is missing the realtime scheduling calls like sched_setscheduler.

Expected Behavior

I'm working on an application that may be improved by realtime scheduling, I can make the call by linking in libc, but should be able to do it with the Zig library.

curuvar avatar Apr 17 '24 00:04 curuvar

It should be noted that the syscall values exist for this, and you could call it with std.os.linux.syscall3(.sched_setscheduler, ...) without linking libc. But I agree that they are missing and probably should be added. Feel free to open a PR to add these helper functions, they should be pretty simple to add in.

Note: Final say is up to the core team of course :)

Rexicon226 avatar Apr 17 '24 08:04 Rexicon226