Lines Matching refs:FileDescriptorVec
383 pub struct FileDescriptorVec { struct
385 pub fds: [Option<Box<File>>; FileDescriptorVec::PROCESS_MAX_FD], argument
388 impl FileDescriptorVec { implementation
391 pub fn new() -> Box<FileDescriptorVec> { in new()
393 let mut data: [MaybeUninit<Option<Box<File>>>; FileDescriptorVec::PROCESS_MAX_FD] = in new()
397 for i in 0..FileDescriptorVec::PROCESS_MAX_FD { in new()
401 let data: [Option<Box<File>>; FileDescriptorVec::PROCESS_MAX_FD] = unsafe { in new()
402 core::mem::transmute::<_, [Option<Box<File>>; FileDescriptorVec::PROCESS_MAX_FD]>(data) in new()
406 return Box::new(FileDescriptorVec { fds: data }); in new()
412 pub fn clone(&self) -> Box<FileDescriptorVec> { in clone() argument
413 let mut res: Box<FileDescriptorVec> = FileDescriptorVec::new(); in clone()
414 for i in 0..FileDescriptorVec::PROCESS_MAX_FD { in clone()
424 pub fn from_pcb(pcb: &'static process_control_block) -> Option<&'static mut FileDescriptorVec> { in from_pcb() argument
425 return unsafe { (pcb.fds as usize as *mut FileDescriptorVec).as_mut() }; in from_pcb()
435 if fd < 0 || fd as usize > FileDescriptorVec::PROCESS_MAX_FD { in validate_fd()