pwd and pty header cleanup
This commit is contained in:
@@ -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), ()> {
|
||||
|
||||
@@ -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")]
|
||||
|
||||
@@ -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,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');
|
||||
|
||||
@@ -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,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');
|
||||
|
||||
Reference in New Issue
Block a user