diff --git a/src/header/locale/mod.rs b/src/header/locale/mod.rs index c77facb84d..ba07c07ece 100644 --- a/src/header/locale/mod.rs +++ b/src/header/locale/mod.rs @@ -1,13 +1,16 @@ -//! locale implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/locale.h.html +//! `locale.h` implementation. +//! +//! See . use core::ptr; -use crate::platform::types::*; +use crate::platform::types::{c_char, c_int}; const EMPTY_PTR: *const c_char = "\0" as *const _ as *const c_char; // Can't use &str because of the mutability static mut C_LOCALE: [c_char; 2] = [b'C' as c_char, 0]; +/// See . #[repr(C)] pub struct lconv { currency_symbol: *const c_char, @@ -54,11 +57,13 @@ static mut CURRENT_LOCALE: lconv = lconv { thousands_sep: EMPTY_PTR, }; +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn localeconv() -> *mut lconv { &raw mut CURRENT_LOCALE as *mut _ } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn setlocale(_option: c_int, _val: *const c_char) -> *mut c_char { // TODO actually implement diff --git a/src/header/sched/mod.rs b/src/header/sched/mod.rs index 7dc80800db..2363edcaa0 100644 --- a/src/header/sched/mod.rs +++ b/src/header/sched/mod.rs @@ -1,40 +1,60 @@ -//! sched.h implementation for Redox, following https://pubs.opengroup.org/onlinepubs/7908799/xsh/sched.h.html +//! `sched.h` implementation. +//! +//! See . use crate::{ error::ResultExt, header::time::timespec, - platform::{Pal, Sys, types::*}, + platform::{ + Pal, Sys, + types::{c_int, pid_t}, + }, }; +/// See . #[derive(Clone, Copy, Debug)] pub struct sched_param { pub sched_priority: c_int, } +/// See . pub const SCHED_FIFO: c_int = 0; +/// See . pub const SCHED_RR: c_int = 1; +/// See . pub const SCHED_OTHER: c_int = 2; +/// See . // #[unsafe(no_mangle)] pub extern "C" fn sched_get_priority_max(policy: c_int) -> c_int { todo!() } + +/// See . // #[unsafe(no_mangle)] pub extern "C" fn sched_get_priority_min(policy: c_int) -> c_int { todo!() } + +/// See . // #[unsafe(no_mangle)] pub unsafe extern "C" fn sched_getparam(pid: pid_t, param: *mut sched_param) -> c_int { todo!() } + +/// See . // #[unsafe(no_mangle)] pub extern "C" fn sched_rr_get_interval(pid: pid_t, time: *const timespec) -> c_int { todo!() } + +/// See . // #[unsafe(no_mangle)] pub unsafe extern "C" fn sched_setparam(pid: pid_t, param: *const sched_param) -> c_int { todo!() } + +/// See . // #[unsafe(no_mangle)] pub extern "C" fn sched_setscheduler( pid: pid_t, @@ -43,6 +63,8 @@ pub extern "C" fn sched_setscheduler( ) -> c_int { todo!() } + +/// See . #[unsafe(no_mangle)] pub extern "C" fn sched_yield() -> c_int { Sys::sched_yield().map(|()| 0).or_minus_one_errno()