diff --git a/src/header/sys_wait/mod.rs b/src/header/sys_wait/mod.rs index e62d23c550..b32ed9f792 100644 --- a/src/header/sys_wait/mod.rs +++ b/src/header/sys_wait/mod.rs @@ -1,9 +1,15 @@ -//! sys/wait.h implementation for Redox, following -//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/syswait.h.html +//! `sys/wait.h` implementation. +//! +//! See . -use crate::{error::ResultExt, out::Out}; -//use header::sys_resource::rusage; -use crate::platform::{Pal, Sys, types::*}; +use crate::{ + error::ResultExt, + out::Out, + platform::{ + Pal, Sys, + types::{c_int, pid_t}, + }, +}; pub const WNOHANG: c_int = 1; pub const WUNTRACED: c_int = 2; @@ -18,20 +24,12 @@ pub const __WALL: c_int = 0x4000_0000; #[allow(overflowing_literals)] pub const __WCLONE: c_int = 0x8000_0000; +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn wait(stat_loc: *mut c_int) -> pid_t { waitpid(!0, stat_loc, 0) } -// #[unsafe(no_mangle)] -// pub unsafe extern "C" fn wait3( -// stat_loc: *mut c_int, -// options: c_int, -// resource_usage: *mut rusage, -// ) -> pid_t { -// unimplemented!(); -// } - /* * TODO: implement idtype_t, id_t, and siginfo_t * @@ -46,6 +44,7 @@ pub unsafe extern "C" fn wait(stat_loc: *mut c_int) -> pid_t { * } */ +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn waitpid(pid: pid_t, stat_loc: *mut c_int, options: c_int) -> pid_t { Sys::waitpid(pid, Out::nullable(stat_loc), options).or_minus_one_errno()