Merge branch 'doc-select-utsname' into 'master'

Doc select utsname

See merge request redox-os/relibc!780
This commit is contained in:
Jeremy Soller
2025-12-07 10:13:47 -07:00
2 changed files with 16 additions and 4 deletions
+7 -2
View File
@@ -1,4 +1,6 @@
//! sys/select.h implementation
//! `sys/select.h` implementation.
//!
//! See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_select.h.html>.
use core::mem;
@@ -14,14 +16,16 @@ 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
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_select.h.html>.
pub const FD_SETSIZE: usize = 1024;
type bitset = BitSet<[u64; FD_SETSIZE / (8 * mem::size_of::<u64>())]>;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_select.h.html>.
#[repr(C)]
pub struct fd_set {
pub fds_bits: bitset,
@@ -161,6 +165,7 @@ pub fn select_epoll(
count
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/pselect.html>.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn select(
nfds: c_int,
+9 -2
View File
@@ -1,13 +1,19 @@
//! sys/utsname implementation, following http://pubs.opengroup.org/onlinepubs/7908799/xsh/sysutsname.h.html
//! `sys/utsname.h` implementation.
//!
//! See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_utsname.h.html>.
use crate::{
error::ResultExt,
out::Out,
platform::{Pal, Sys, types::*},
platform::{
Pal, Sys,
types::{c_char, c_int},
},
};
pub const UTSLENGTH: usize = 65;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_utsname.h.html>.
#[repr(C)]
#[derive(Clone, Copy, Debug, OutProject)]
pub struct utsname {
@@ -19,6 +25,7 @@ pub struct utsname {
pub domainname: [c_char; UTSLENGTH],
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/uname.html>.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn uname(uts: *mut utsname) -> c_int {
Sys::uname(Out::nonnull(uts))