zig icon indicating copy to clipboard operation
zig copied to clipboard

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

Open Uthedris opened this issue 1 year ago • 1 comments

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

Uthedris avatar Apr 17 '24 15:04 Uthedris

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. :slightly_smiling_face:

alexrp avatar Oct 10 '24 14:10 alexrp

@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.

alexrp avatar Nov 12 '24 21:11 alexrp

I’ll make the changes.

On 12 Nov 24, at 16:16, Alex Rønne Petersen @.***> wrote:

@curuvar https://github.com/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.

— Reply to this email directly, view it on GitHub https://github.com/ziglang/zig/pull/19675#issuecomment-2471599817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOAJTISOP6SW53SI2ZWORHD2AJV2BAVCNFSM6AAAAABGLQDXRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZRGU4TSOBRG4. You are receiving this because you were mentioned.

Uthedris avatar Nov 12 '24 21:11 Uthedris

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.

Uthedris avatar Nov 13 '24 11:11 Uthedris

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

alexrp avatar Nov 13 '24 20:11 alexrp