Merge branch 'pwd-pty-cleanup' into 'master'

pwd and pty header cleanup

See merge request redox-os/relibc!865
This commit is contained in:
Jeremy Soller
2026-01-06 06:22:06 -07:00
6 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
use crate::{
header::{fcntl, sys_ioctl, unistd},
io::{Cursor, Write},
platform::types::*,
platform::types::{c_char, c_int, c_void},
};
pub(super) unsafe fn openpty(name: &mut [u8]) -> Result<(c_int, c_int), ()> {
+4 -1
View File
@@ -6,7 +6,10 @@ use core::{mem, ptr, slice};
use crate::{
header::{fcntl, limits, pthread, signal, sys_ioctl, sys_wait, termios, unistd, utmp},
platform::{self, types::*},
platform::{
self,
types::{c_char, c_int, c_void},
},
};
#[cfg(target_os = "linux")]
+1 -1
View File
@@ -2,7 +2,7 @@ use crate::{
Pal, Sys,
error::ResultExt,
header::{fcntl, unistd},
platform::types::*,
platform::types::{c_char, c_int, ssize_t},
};
pub(super) unsafe fn openpty(name: &mut [u8]) -> Result<(c_int, c_int), ()> {
+1 -1
View File
@@ -1,5 +1,5 @@
use super::{parsed, passwd};
use crate::platform::types::*;
use crate::platform::types::c_char;
pub fn split(line: &mut [u8]) -> Option<passwd> {
let mut parts = line.split_mut(|&c| c == b'\0');
+7 -1
View File
@@ -13,7 +13,10 @@ use crate::{
fs::File,
header::{errno, fcntl, string::strcmp},
io::{BufReader, SeekFrom, prelude::*},
platform::{self, types::*},
platform::{
self,
types::{c_char, c_int, gid_t, size_t, uid_t},
},
raw_cell::RawCell,
};
@@ -128,6 +131,9 @@ where
string.parse().ok()
}
/// See <https://www.man7.org/linux/man-pages/man3/getpwent_r.3.html>.
///
/// Non-POSIX
fn getpwent_r(
reader: &mut BufReader<File>,
destination: Option<DestBuffer>,
+1 -1
View File
@@ -1,5 +1,5 @@
use super::{parsed, passwd};
use crate::platform::types::*;
use crate::platform::types::c_char;
pub fn split(line: &mut [u8]) -> Option<passwd> {
let mut parts = line.split_mut(|&c| c == b'\0');