Lines Matching refs:file
5 filesystem::vfs::file::FileDescriptorVec,
16 file::{File, FileMode},
176 let mut file: File = File::new(inode, mode)?; in open() localVariable
180 file.lseek(SeekFrom::SeekEnd(0))?; in open()
184 let r = current_pcb().alloc_fd(file, None).map(|fd| fd as usize); in open()
208 let file: Option<&mut File> = current_pcb().get_file_mut_by_fd(fd); in read() localVariable
209 if file.is_none() { in read()
212 let file: &mut File = file.unwrap(); in read() localVariable
214 return file.read(buf.len(), buf); in read()
226 let file: Option<&mut File> = current_pcb().get_file_mut_by_fd(fd); in write() localVariable
227 if file.is_none() { in write()
230 let file: &mut File = file.unwrap(); in write() localVariable
232 return file.write(buf.len(), buf); in write()
244 let file: Option<&mut File> = current_pcb().get_file_mut_by_fd(fd); in lseek() localVariable
245 if file.is_none() { in lseek()
248 let file: &mut File = file.unwrap(); in lseek() localVariable
249 return file.lseek(seek); in lseek()
317 let file: &mut File = match current_pcb().get_file_mut_by_fd(fd) { in getdents() localVariable
321 Some(file) => file, in getdents()
325 return file.readdir(dirent).map(|x| x as usize); in getdents()
382 if let Some(file) = &fds.fds[oldfd as usize] { in dup()
384 let file_cp: Box<File> = file.try_clone().ok_or(SystemError::EBADF)?; in dup()
422 if let Some(file) = &fds.fds[oldfd as usize] { in dup2()
432 let file_cp = file.try_clone(); in dup2()
480 if let Some(file) = &fds.fds[fd as usize] { in fcntl()
481 if file.close_on_exec() { in fcntl()
494 if let Some(file) = &mut fds.fds[fd as usize] { in fcntl()
497 file.set_close_on_exec(true); in fcntl()
499 file.set_close_on_exec(false); in fcntl()
513 if let Some(file) = &fds.fds[fd as usize] { in fcntl()
514 return Ok(file.mode().bits() as usize); in fcntl()
525 if let Some(file) = &mut fds.fds[fd as usize] { in fcntl()
528 file.set_mode(mode)?; in fcntl()
565 if let Some(file) = &mut fds.fds[fd as usize] { in ftruncate()
566 let r = file.ftruncate(len).map(|_| 0); in ftruncate()
577 Some(file) => { in do_fstat()
580 match file.metadata() { in do_fstat()
600 match file.file_type() { in do_fstat()