This commit is contained in:
Jeremy Soller
2025-11-17 17:41:04 -07:00
parent 91ba44e2fa
commit e3cafc975f
3 changed files with 12 additions and 3 deletions
+6 -1
View File
@@ -896,7 +896,12 @@ impl FdTbl {
impl FdTbl {
pub fn enumerate(&self) -> impl Iterator<Item = (usize, &Option<FileDescriptor>)> {
self.posix_fdtbl.iter().enumerate().chain(self.upper_fdtbl.iter().enumerate().map(|(i, fd)| (i | UPPER_FDTBL_TAG, fd)))
self.posix_fdtbl.iter().enumerate().chain(
self.upper_fdtbl
.iter()
.enumerate()
.map(|(i, fd)| (i | UPPER_FDTBL_TAG, fd)),
)
}
pub fn iter(&self) -> impl Iterator<Item = &Option<FileDescriptor>> {
+1 -1
View File
@@ -127,7 +127,7 @@ impl KernelScheme for DtbScheme {
dst_buf.copy_common_bytes_from_slice(src_buf)
}
fn kfpath(&self, id: usize, buf: UserSliceWo, token: &mut CleanLockToken) -> Result<usize> {
//TODO: construct useful path?
buf.copy_common_bytes_from_slice("/scheme/kernel.dtb/".as_bytes())
+5 -1
View File
@@ -45,7 +45,11 @@ fn inner(fpath_user: UserSliceRw, token: &mut CleanLockToken) -> Result<Vec<u8>>
let _ = write!(
string,
"{} {:>4}: {:>8} {:>8} {:>08X}: ",
if fd & syscall::UPPER_FDTBL_TAG == 0 { " " } else { "U" },
if fd & syscall::UPPER_FDTBL_TAG == 0 {
" "
} else {
"U"
},
fd & !syscall::UPPER_FDTBL_TAG,
description.scheme.get(),
description.number,