Home
last modified time | relevance | path

Searched refs:FileDescriptorVec (Results 1 – 3 of 3) sorted by relevance

/DragonOS-0.1.7/kernel/src/process/
Dprocess.rs11 file::{File, FileDescriptorVec, FileMode},
127 let fd_vec: &mut FileDescriptorVec = Box::leak(FileDescriptorVec::new()); in init_files()
128 self.fds = fd_vec as *mut FileDescriptorVec as usize as *mut c_void; in init_files()
152 let old_fds: &mut FileDescriptorVec = if let Some(o_fds) = FileDescriptorVec::from_pcb(from) in copy_files()
160 let new_fd_vec: &mut FileDescriptorVec = Box::leak(old_fds.clone()); in copy_files()
162 self.fds = new_fd_vec as *mut FileDescriptorVec as usize as *mut c_void; in copy_files()
173 let old_fds: Box<FileDescriptorVec> = in exit_files()
174 unsafe { Box::from_raw(self.fds as *mut FileDescriptorVec) }; in exit_files()
189 let fds: &mut FileDescriptorVec = in alloc_fd()
190 if let Some(f) = FileDescriptorVec::from_pcb(current_pcb()) { in alloc_fd()
[all …]
/DragonOS-0.1.7/kernel/src/filesystem/vfs/
Dfile.rs318 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
[all …]
Dsyscall.rs7 filesystem::vfs::file::FileDescriptorVec,
352 if let Some(fds) = FileDescriptorVec::from_pcb(current_pcb()) { in do_dup()
355 if FileDescriptorVec::validate_fd(oldfd) { in do_dup()
388 if let Some(fds) = FileDescriptorVec::from_pcb(current_pcb()) { in do_dup2()
390 if FileDescriptorVec::validate_fd(oldfd) && FileDescriptorVec::validate_fd(newfd) { in do_dup2()