From 5d4b6bc2ee1a1dbb683fda7cecba1f72ef7f6215 Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 22 Dec 2025 10:12:50 +0000 Subject: [PATCH 1/2] update and add spec links for glob and setjmp --- src/header/glob/mod.rs | 7 ++++++- src/header/setjmp/mod.rs | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/header/glob/mod.rs b/src/header/glob/mod.rs index 38dbcd62dc..3606f4aa3f 100644 --- a/src/header/glob/mod.rs +++ b/src/header/glob/mod.rs @@ -1,4 +1,6 @@ -//! glob implementation, following https://pubs.opengroup.org/onlinepubs/9699919799/functions/glob.html +//! `glob.h` implementation. +//! +//! See . #![deny(unsafe_op_in_unsafe_fn)] @@ -41,6 +43,7 @@ pub const GLOB_ABORTED: c_int = 2; // Pattern does not match any existing pathname, and GLOB_NOCHECK was not set pub const GLOB_NOMATCH: c_int = 3; +/// See . #[derive(Debug)] #[repr(C)] pub struct glob_t { @@ -52,6 +55,7 @@ pub struct glob_t { __opaque: *mut c_void, // Vec<*mut c_char> } +/// See . #[linkage = "weak"] // GNU prefers its own glob e.g. in Make #[unsafe(no_mangle)] pub unsafe extern "C" fn glob( @@ -146,6 +150,7 @@ pub unsafe extern "C" fn glob( 0 } +/// See . #[linkage = "weak"] // GNU prefers its own glob e.g. in Make #[unsafe(no_mangle)] pub unsafe extern "C" fn globfree(pglob: *mut glob_t) { diff --git a/src/header/setjmp/mod.rs b/src/header/setjmp/mod.rs index c6ab32a478..32679f4008 100644 --- a/src/header/setjmp/mod.rs +++ b/src/header/setjmp/mod.rs @@ -1,4 +1,6 @@ -//! setjmp implementation for Redox, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/setjmp.h.html +//! `setjmp.h` implementation. +//! +//! See . use core::arch::global_asm; @@ -22,6 +24,8 @@ platform_specific! { //Each platform has different sizes for sigjmp_buf, currently only x86_64 is supported unsafe extern "C" { + /// See . pub fn setjmp(jb: *mut u64) -> i32; + /// See . pub fn longjmp(jb: *mut u64, ret: i32); } From 4102e1b47d99a06b9155106b4cf42ad5fc3be449 Mon Sep 17 00:00:00 2001 From: auronandace Date: Mon, 22 Dec 2025 10:16:15 +0000 Subject: [PATCH 2/2] only import needed types --- src/header/glob/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/header/glob/mod.rs b/src/header/glob/mod.rs index 3606f4aa3f..ff7995d0a1 100644 --- a/src/header/glob/mod.rs +++ b/src/header/glob/mod.rs @@ -16,7 +16,10 @@ use crate::{ fnmatch::{FNM_NOESCAPE, FNM_PERIOD, fnmatch}, sys_stat::{S_IFDIR, S_IFLNK, S_IFMT, stat}, }, - platform::{self, types::*}, + platform::{ + self, + types::{c_char, c_int, c_uchar, c_void, size_t}, + }, }; // Cause glob() to return on error