Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add realtime scheduling calls to std.os.linux (issue #19671) #19675

Merged
merged 15 commits into from
Nov 16, 2024

Conversation

curuvar
Copy link
Contributor

@curuvar curuvar commented Apr 17, 2024

Add the following system calls to std.os.linux:

  • sched_setscheduler
  • sched_getscheduler
  • sched_setparam
  • sched_getparam
  • sched_get_priority_min
  • sched_get_priority_max

Also add required sched_param structure and SCHED constant definitions:

  • pub const sched_param
  • pub const SCHED

Closes #19671.

lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
@alexrp
Copy link
Member

alexrp commented Oct 10, 2024

Looks good with a few minor adjustments.

If you feel like it, it would be nice to also have these:

  • sched_getcpu
  • sched_getattr/sched_setattr
  • sched_rr_get_interval

But that's not required to merge this, so if you don't feel like it, that's totally fine. 🙂

@alexrp
Copy link
Member

alexrp commented Nov 12, 2024

@curuvar do you think you'll be able to address my review comments soon? If you don't have time, that's totally fine; I can make the adjustments in that case.

@curuvar
Copy link
Contributor Author

curuvar commented Nov 12, 2024 via email

@curuvar
Copy link
Contributor Author

curuvar commented Nov 13, 2024

I made the requested changes and added:

sched_getcpu
sched_getattr
sched_setattr
sched_rr_get_interval

and "getcpu" as it was needed for sched_getcpu.

lib/std/os/linux.zig Outdated Show resolved Hide resolved
lib/std/os/linux.zig Outdated Show resolved Hide resolved
@alexrp
Copy link
Member

alexrp commented Nov 13, 2024

Nice, thanks! Just a couple of naming nitpicks and I think this one is good to go.

lib/std/os/linux.zig Outdated Show resolved Hide resolved
@alexrp alexrp enabled auto-merge (squash) November 16, 2024 16:29
@alexrp alexrp merged commit 53a232e into ziglang:master Nov 16, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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