Lines Matching refs:FileDescriptorVec
318 pub struct FileDescriptorVec { struct
320 pub fds: [Option<Box<File>>; FileDescriptorVec::PROCESS_MAX_FD], argument
323 impl FileDescriptorVec { impl
326 pub fn new() -> Box<FileDescriptorVec> { in new()
328 let mut data: [MaybeUninit<Option<Box<File>>>; FileDescriptorVec::PROCESS_MAX_FD] = in new()
332 for i in 0..FileDescriptorVec::PROCESS_MAX_FD { in new()
336 let data: [Option<Box<File>>; FileDescriptorVec::PROCESS_MAX_FD] = unsafe { in new()
337 core::mem::transmute::<_, [Option<Box<File>>; FileDescriptorVec::PROCESS_MAX_FD]>(data) in new()
341 return Box::new(FileDescriptorVec { fds: data }); in new()
347 pub fn clone(&self) -> Box<FileDescriptorVec> { in clone() argument
348 let mut res: Box<FileDescriptorVec> = FileDescriptorVec::new(); in clone()
349 for i in 0..FileDescriptorVec::PROCESS_MAX_FD { in clone()
359 pub fn from_pcb(pcb: &'static process_control_block) -> Option<&'static mut FileDescriptorVec> { in from_pcb() argument
360 return unsafe { (pcb.fds as usize as *mut FileDescriptorVec).as_mut() }; in from_pcb()
370 if fd < 0 || fd as usize > FileDescriptorVec::PROCESS_MAX_FD { in validate_fd()