From 03c646222ed575a357ff9e5b87823a989cabc005 Mon Sep 17 00:00:00 2001 From: auronandace Date: Sat, 11 Oct 2025 19:21:36 +0100 Subject: [PATCH] update spec links and imports for libgen and sys_resource --- src/header/libgen/mod.rs | 6 +++++- src/header/sys_resource/mod.rs | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/header/libgen/mod.rs b/src/header/libgen/mod.rs index 54a16410b5..4b174444eb 100644 --- a/src/header/libgen/mod.rs +++ b/src/header/libgen/mod.rs @@ -1,4 +1,6 @@ -//! libgen implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/libgen.h.html +//! `libgen.h` implementation. +//! +//! See . #![deny(unsafe_op_in_unsafe_fn)] @@ -6,6 +8,7 @@ use crate::platform::types::c_char; use crate::header::string::strlen; +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn basename(str: *mut c_char) -> *mut c_char { if str.is_null() || unsafe { strlen(str) == 0 } { @@ -28,6 +31,7 @@ pub unsafe extern "C" fn basename(str: *mut c_char) -> *mut c_char { } } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn dirname(str: *mut c_char) -> *mut c_char { if str.is_null() || unsafe { strlen(str) == 0 } { diff --git a/src/header/sys_resource/mod.rs b/src/header/sys_resource/mod.rs index 361c3d544c..829bb2ba9b 100644 --- a/src/header/sys_resource/mod.rs +++ b/src/header/sys_resource/mod.rs @@ -1,11 +1,15 @@ -//! sys/resource.h implementation for Redox, following -//! http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysresource.h.html +//! `sys/resource.h` implementation. +//! +//! See . use crate::{ error::ResultExt, header::sys_time::timeval, out::Out, - platform::{Pal, Sys, types::*}, + platform::{ + Pal, Sys, + types::{c_int, c_long, id_t}, + }, }; // Exported in bits file @@ -67,6 +71,7 @@ pub const PRIO_PROCESS: c_int = 0; pub const PRIO_PGRP: c_int = 1; pub const PRIO_USER: c_int = 2; +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn getpriority(which: c_int, who: id_t) -> c_int { let r = Sys::getpriority(which, who).or_minus_one_errno(); @@ -76,6 +81,7 @@ pub unsafe extern "C" fn getpriority(which: c_int, who: id_t) -> c_int { 20 - r } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn setpriority(which: c_int, who: id_t, nice: c_int) -> c_int { Sys::setpriority(which, who, nice) @@ -83,6 +89,7 @@ pub unsafe extern "C" fn setpriority(which: c_int, who: id_t, nice: c_int) -> c_ .or_minus_one_errno() } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int { let rlp = Out::nonnull(rlp); @@ -92,6 +99,7 @@ pub unsafe extern "C" fn getrlimit(resource: c_int, rlp: *mut rlimit) -> c_int { .or_minus_one_errno() } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn setrlimit(resource: c_int, rlp: *const rlimit) -> c_int { Sys::setrlimit(resource, rlp) @@ -99,6 +107,7 @@ pub unsafe extern "C" fn setrlimit(resource: c_int, rlp: *const rlimit) -> c_int .or_minus_one_errno() } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn getrusage(who: c_int, r_usage: *mut rusage) -> c_int { Sys::getrusage(who, Out::nonnull(r_usage))