Lines Matching refs:fd
692 for fd in &self.fds { in fd_open_count()
693 if fd.is_some() { in fd_open_count()
706 pub fn validate_fd(fd: i32) -> bool { in validate_fd()
707 return !(fd < 0 || fd as usize > FileDescriptorVec::PROCESS_MAX_FD); in validate_fd()
721 pub fn alloc_fd(&mut self, file: File, fd: Option<i32>) -> Result<i32, SystemError> { in alloc_fd()
722 if let Some(new_fd) = fd { in alloc_fd()
747 pub fn get_file_by_fd(&self, fd: i32) -> Option<Arc<File>> { in get_file_by_fd()
748 if !FileDescriptorVec::validate_fd(fd) { in get_file_by_fd()
751 self.fds[fd as usize].clone() in get_file_by_fd()
759 pub fn drop_fd(&mut self, fd: i32) -> Result<Arc<File>, SystemError> { in drop_fd()
760 self.get_file_by_fd(fd).ok_or(SystemError::EBADF)?; in drop_fd()
763 let file = self.fds[fd as usize].take().unwrap(); in drop_fd()
808 let fd = self.index as i32; in next() localVariable
810 if let Some(file) = self.fds.get_file_by_fd(fd) { in next()
811 return Some((fd, file)); in next()