Lines Matching refs:fd
189 pub fn alloc_fd(&mut self, file: File, fd: Option<i32>) -> Result<i32, SystemError> { in alloc_fd()
206 if fd.is_some() { in alloc_fd()
208 let new_fd = fd.unwrap(); in alloc_fd()
235 pub fn get_file_mut_by_fd(&self, fd: i32) -> Option<&mut File> { in get_file_mut_by_fd()
236 if !FileDescriptorVec::validate_fd(fd) { in get_file_mut_by_fd()
240 return r.fds[fd as usize].as_deref_mut(); in get_file_mut_by_fd()
249 pub fn get_file_ref_by_fd(&self, fd: i32) -> Option<&File> { in get_file_ref_by_fd()
250 if !FileDescriptorVec::validate_fd(fd) { in get_file_ref_by_fd()
254 return r.fds[fd as usize].as_deref(); in get_file_ref_by_fd()
260 pub fn drop_fd(&self, fd: i32) -> Result<(), SystemError> { in drop_fd()
262 if !FileDescriptorVec::validate_fd(fd) { in drop_fd()
267 let f: Option<&File> = r.fds[fd as usize].as_deref(); in drop_fd()
276 r.fds[fd as usize] = None; in drop_fd()
304 pub fn get_socket(&self, fd: i32) -> Option<Arc<SocketInode>> { in get_socket()
305 let f = self.get_file_mut_by_fd(fd)?; in get_socket()