Feature request: support for `sched_setscheduler`
There is currently no support for getting or setting the scheduling policies with sched_getscheduler and sched_setscheduler respectively. I use this on Linux with PREEMPT_RT to set realtime priorities and FIFO scheduling, currently with libc.
Other related parts are also not in rustix, e.g. to set the stack size (pthread).
Would you consider this in scope of rustix?
I'm not very familiar with pthread_setschedparam, but at first glance, it looks like it's more than just a trivial wrapper around sched_setscheduler, and it does things that only libc can do. I am familiar with pthread_attr_setstacksize, and I know that it's doing things that only libc can do. So it seems the best thing for users of these functions would be to continue to use libc.
If a safe interface to these functions is desired, it'd ideally go in a separate library from rustix, as it would just wrap libc and wouldn't require access to rustix's internals.
As a user, the ergonomics of rustix is very nice. Since libc is listed as a backend, I thought these APIs could be considered. What you write make sense though.
I leave this issue open in case anybody else wants to comment and will close it after a couple of days. Thank you for your input and great work!