From ccc1d0b6fed101b49d0a682fabb5234f41f760b8 Mon Sep 17 00:00:00 2001 From: auronandace Date: Tue, 2 Dec 2025 19:30:19 +0000 Subject: [PATCH 1/3] remove commented out wait3 and rusage --- src/header/sys_wait/mod.rs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/header/sys_wait/mod.rs b/src/header/sys_wait/mod.rs index e62d23c550..af1b49a317 100644 --- a/src/header/sys_wait/mod.rs +++ b/src/header/sys_wait/mod.rs @@ -2,7 +2,6 @@ //! http://pubs.opengroup.org/onlinepubs/7908799/xsh/syswait.h.html use crate::{error::ResultExt, out::Out}; -//use header::sys_resource::rusage; use crate::platform::{Pal, Sys, types::*}; pub const WNOHANG: c_int = 1; @@ -23,15 +22,6 @@ 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 * From ec9fd09335401ae3107035f47de6eb063496fce0 Mon Sep 17 00:00:00 2001 From: auronandace Date: Tue, 2 Dec 2025 19:34:32 +0000 Subject: [PATCH 2/3] update header spec link, add spec links to functions --- src/header/sys_wait/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/header/sys_wait/mod.rs b/src/header/sys_wait/mod.rs index af1b49a317..c8e5dee88d 100644 --- a/src/header/sys_wait/mod.rs +++ b/src/header/sys_wait/mod.rs @@ -1,5 +1,6 @@ -//! 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 crate::platform::{Pal, Sys, types::*}; @@ -17,6 +18,7 @@ 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) @@ -36,6 +38,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() From 68b4693564ac0fea595945a756ecba149821a3f9 Mon Sep 17 00:00:00 2001 From: auronandace Date: Tue, 2 Dec 2025 19:37:16 +0000 Subject: [PATCH 3/3] only import needed types in sys_wait --- src/header/sys_wait/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/header/sys_wait/mod.rs b/src/header/sys_wait/mod.rs index c8e5dee88d..b32ed9f792 100644 --- a/src/header/sys_wait/mod.rs +++ b/src/header/sys_wait/mod.rs @@ -2,8 +2,14 @@ //! //! See . -use crate::{error::ResultExt, out::Out}; -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;