From 64d688dc4ed53a14e42e387e9f7e9a5d4a23dc4b Mon Sep 17 00:00:00 2001 From: auronandace Date: Sun, 7 Dec 2025 17:01:51 +0000 Subject: [PATCH 1/2] update and add spec links to sys_utsname and sys_select --- src/header/sys_select/mod.rs | 7 ++++++- src/header/sys_utsname/mod.rs | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/header/sys_select/mod.rs b/src/header/sys_select/mod.rs index 2ffc823c1c..51e8901351 100644 --- a/src/header/sys_select/mod.rs +++ b/src/header/sys_select/mod.rs @@ -1,4 +1,6 @@ -//! sys/select.h implementation +//! `sys/select.h` implementation. +//! +//! See . use core::mem; @@ -19,9 +21,11 @@ use crate::{ // fd_set is also defined in C because cbindgen is incompatible with mem::size_of booo +/// See . pub const FD_SETSIZE: usize = 1024; type bitset = BitSet<[u64; FD_SETSIZE / (8 * mem::size_of::())]>; +/// See . #[repr(C)] pub struct fd_set { pub fds_bits: bitset, @@ -161,6 +165,7 @@ pub fn select_epoll( count } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn select( nfds: c_int, diff --git a/src/header/sys_utsname/mod.rs b/src/header/sys_utsname/mod.rs index 2ca93e38b5..da72961bd8 100644 --- a/src/header/sys_utsname/mod.rs +++ b/src/header/sys_utsname/mod.rs @@ -1,4 +1,6 @@ -//! sys/utsname implementation, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysutsname.h.html +//! `sys/utsname.h` implementation. +//! +//! See . use crate::{ error::ResultExt, @@ -8,6 +10,7 @@ use crate::{ pub const UTSLENGTH: usize = 65; +/// See . #[repr(C)] #[derive(Clone, Copy, Debug, OutProject)] pub struct utsname { @@ -19,6 +22,7 @@ pub struct utsname { pub domainname: [c_char; UTSLENGTH], } +/// See . #[unsafe(no_mangle)] pub unsafe extern "C" fn uname(uts: *mut utsname) -> c_int { Sys::uname(Out::nonnull(uts)) From bb7ad197925555f150f92cf24a39d1916816db13 Mon Sep 17 00:00:00 2001 From: auronandace Date: Sun, 7 Dec 2025 17:04:59 +0000 Subject: [PATCH 2/2] only import the needed types for sys_utsname and sys_select --- src/header/sys_select/mod.rs | 2 +- src/header/sys_utsname/mod.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/header/sys_select/mod.rs b/src/header/sys_select/mod.rs index 51e8901351..8124f211a9 100644 --- a/src/header/sys_select/mod.rs +++ b/src/header/sys_select/mod.rs @@ -16,7 +16,7 @@ use crate::{ }, sys_time::timeval, }, - platform::{self, types::*}, + platform::{self, types::c_int}, }; // fd_set is also defined in C because cbindgen is incompatible with mem::size_of booo diff --git a/src/header/sys_utsname/mod.rs b/src/header/sys_utsname/mod.rs index da72961bd8..8751727430 100644 --- a/src/header/sys_utsname/mod.rs +++ b/src/header/sys_utsname/mod.rs @@ -5,7 +5,10 @@ use crate::{ error::ResultExt, out::Out, - platform::{Pal, Sys, types::*}, + platform::{ + Pal, Sys, + types::{c_char, c_int}, + }, }; pub const UTSLENGTH: usize = 65;