Files
RedBear-OS/src/header/sched/mod.rs
T
2024-09-26 16:24:01 +02:00

50 lines
1.2 KiB
Rust

//! sched.h implementation for Redox, following https://pubs.opengroup.org/onlinepubs/7908799/xsh/sched.h.html
use crate::{
error::ResultExt,
header::time::timespec,
platform::{types::*, Pal, Sys},
};
#[derive(Clone, Copy, Debug)]
pub struct sched_param {
pub sched_priority: c_int,
}
pub const SCHED_FIFO: c_int = 0;
pub const SCHED_RR: c_int = 1;
pub const SCHED_OTHER: c_int = 2;
// #[no_mangle]
pub extern "C" fn sched_get_priority_max(policy: c_int) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_get_priority_min(policy: c_int) -> c_int {
todo!()
}
// #[no_mangle]
pub unsafe extern "C" fn sched_getparam(pid: pid_t, param: *mut sched_param) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_rr_get_interval(pid: pid_t, time: *const timespec) -> c_int {
todo!()
}
// #[no_mangle]
pub unsafe extern "C" fn sched_setparam(pid: pid_t, param: *const sched_param) -> c_int {
todo!()
}
// #[no_mangle]
pub extern "C" fn sched_setscheduler(
pid: pid_t,
policy: c_int,
param: *const sched_param,
) -> c_int {
todo!()
}
#[no_mangle]
pub extern "C" fn sched_yield() -> c_int {
Sys::sched_yield().map(|()| 0).or_minus_one_errno()
}