Home
last modified time | relevance | path

Searched refs:FileMode (Results 1 – 25 of 38) sorted by relevance

12

/DragonOS/kernel/src/process/
H A Dstdio.rs6 file::{File, FileMode},
28 File::new(tty_inode.clone(), FileMode::O_RDONLY).expect("Init stdio: can't create stdin"); in stdio_init()
30 File::new(tty_inode.clone(), FileMode::O_WRONLY).expect("Init stdio: can't create stdout"); in stdio_init()
31 let stderr = File::new(tty_inode.clone(), FileMode::O_WRONLY | FileMode::O_SYNC) in stdio_init()
H A Dexec.rs9 file::{File, FileMode},
124 let file = File::new(inode, FileMode::O_RDONLY)?; in new()
/DragonOS/kernel/src/ipc/
H A Dpipe.rs3 core::generate_inode_id, file::FileMode, syscall::ModeType, FilePrivateData, FileSystem,
28 mode: FileMode,
32 pub fn new(mode: FileMode) -> Self { in new()
36 pub fn set_mode(&mut self, mode: FileMode) { in set_mode() argument
75 if mode.contains(FileMode::O_RDONLY) { in poll()
87 if mode.contains(FileMode::O_WRONLY) { in poll()
194 let mode: FileMode; in read_at()
219 if mode.contains(FileMode::O_NONBLOCK) { in read_at()
279 mode: &crate::filesystem::vfs::file::FileMode, in open() argument
283 if mode.contains(FileMode::O_RDWR) { in open()
[all …]
H A Dsyscall.rs15 file::{File, FileMode},
51 pub fn pipe2(fd: *mut i32, flags: FileMode) -> Result<usize, SystemError> { in pipe2()
53 .difference(FileMode::O_CLOEXEC | FileMode::O_NONBLOCK | FileMode::O_DIRECT) in pipe2()
65 FileMode::O_RDONLY | (flags & FileMode::O_NONBLOCK), in pipe2()
68 FileMode::O_RDONLY, in pipe2()
73 FileMode::O_WRONLY | (flags & (FileMode::O_NONBLOCK | FileMode::O_DIRECT)), in pipe2()
76 FileMode::O_WRONLY | (flags & (FileMode::O_NONBLOCK | FileMode::O_DIRECT)), in pipe2()
79 if flags.contains(FileMode::O_CLOEXEC) { in pipe2()
/DragonOS/kernel/src/filesystem/vfs/
H A Dopen.rs7 file::{File, FileMode},
155 o_flags: FileMode, in do_sys_open() argument
186 if how.o_flags.contains(FileMode::O_CREAT) in do_sys_openat2()
187 && !how.o_flags.contains(FileMode::O_DIRECTORY) in do_sys_openat2()
210 if how.o_flags.contains(FileMode::O_DIRECTORY) && file_type != FileType::Dir { in do_sys_openat2()
219 if how.o_flags.contains(FileMode::O_APPEND) { in do_sys_openat2()
224 if how.o_flags.contains(FileMode::O_TRUNC) in do_sys_openat2()
225 && (how.o_flags.contains(FileMode::O_RDWR) || how.o_flags.contains(FileMode::O_WRONLY)) in do_sys_openat2()
H A Dfile.rs58 pub fn update_mode(&mut self, mode: FileMode) { in update_mode() argument
72 pub struct FileMode: u32{
119 impl FileMode { impl
123 return self.bits() & FileMode::O_ACCMODE.bits(); in accmode()
203 mode: RwLock<FileMode>,
218 pub fn new(inode: Arc<dyn IndexNode>, mode: FileMode) -> Result<Self, SystemError> { in new()
420 if *self.mode.read() == FileMode::O_WRONLY { in readable()
431 if *self.mode.read() == FileMode::O_RDONLY { in writeable()
531 pub fn mode(&self) -> FileMode { in mode() argument
538 return self.mode().contains(FileMode::O_CLOEXEC); in close_on_exec()
[all …]
H A Dsyscall.rs28 file::{File, FileMode},
407 pub o_flags: FileMode,
413 pub fn new(mut o_flags: FileMode, mut mode: ModeType, resolve: OpenHowResolve) -> Self { in new() argument
414 if !o_flags.contains(FileMode::O_CREAT) { in new()
418 if o_flags.contains(FileMode::O_PATH) { in new()
419 o_flags = o_flags.intersection(FileMode::O_PATH_FLAGS); in new()
432 let o_flags = FileMode::from_bits_truncate(posix_open_how.flags as u32); in from()
494 let open_flags: FileMode = FileMode::from_bits(o_flags).ok_or(SystemError::EINVAL)?; in open()
516 let open_flags: FileMode = FileMode::from_bits(o_flags).ok_or(SystemError::EINVAL)?; in openat()
809 FileMode::from_bits_truncate(mode as u32), in mkdir()
[all …]
H A Dcore.rs26 file::FileMode,
172 mode: FileMode, in do_mkdir_at() argument
350 FileMode::from_bits_truncate(0o755), in do_mount_mkdir()
/DragonOS/kernel/src/net/event_poll/
H A Dsyscall.rs5 filesystem::vfs::file::FileMode,
23 return EventPoll::do_create_epoll(FileMode::empty()); in epoll_create()
27 let flags = FileMode::from_bits_truncate(flag as u32); in epoll_create1()
H A Dmod.rs17 file::{File, FileMode},
228 _mode: &FileMode, in open() argument
242 pub fn do_create_epoll(flags: FileMode) -> Result<usize, SystemError> { in do_create_epoll()
243 if !flags.difference(FileMode::O_CLOEXEC).is_empty() { in do_create_epoll()
256 FileMode::O_RDWR | (flags & FileMode::O_CLOEXEC), in do_create_epoll()
/DragonOS/kernel/src/driver/tty/tty_ldisc/
H A Dmod.rs6 use crate::filesystem::vfs::file::FileMode;
35 mode: FileMode, in read() argument
42 mode: FileMode, in write() argument
/DragonOS/kernel/src/net/
H A Dsyscall.rs10 file::{File, FileMode},
27 const SOCK_CLOEXEC: FileMode = FileMode::O_CLOEXEC;
28 const SOCK_NONBLOCK: FileMode = FileMode::O_NONBLOCK;
48 let f = File::new(socketinode, FileMode::O_RDWR)?; in socket()
91 fds[0] = fd_table_guard.alloc_fd(File::new(inode0, FileMode::O_RDWR)?, None)?; in socketpair()
92 fds[1] = fd_table_guard.alloc_fd(File::new(inode1, FileMode::O_RDWR)?, None)?; in socketpair()
391 if SOCK_NONBLOCK != FileMode::O_NONBLOCK && ((flags & SOCK_NONBLOCK.bits()) != 0) { in accept4()
392 flags = (flags & !FileMode::O_NONBLOCK.bits()) | FileMode::O_NONBLOCK.bits(); in accept4()
417 let mut file_mode = FileMode::O_RDWR; in do_accept()
419 file_mode |= FileMode::O_NONBLOCK; in do_accept()
[all …]
/DragonOS/kernel/src/bpf/prog/
H A Dmod.rs8 use crate::filesystem::vfs::file::{File, FileMode};
48 fn open(&self, _data: SpinLockGuard<FilePrivateData>, _mode: &FileMode) -> Result<()> { in open()
120 let file = File::new(Arc::new(prog), FileMode::O_RDWR)?; in bpf_prog_load()
/DragonOS/kernel/src/filesystem/
H A Deventfd.rs1 use crate::filesystem::vfs::file::{File, FileMode};
91 _mode: &FileMode, in open() argument
271 FileMode::O_RDWR | FileMode::O_CLOEXEC in sys_eventfd()
273 FileMode::O_RDWR in sys_eventfd()
/DragonOS/kernel/src/virt/kvm/
H A Dkvm_dev.rs6 file::{File, FileMode},
96 _mode: &FileMode, in open() argument
190 let file: File = File::new(vm_inode, FileMode::O_RDWR)?; in kvm_dev_ioctl_create_vm()
H A Dvm_dev.rs6 file::{File, FileMode},
102 _mode: &FileMode, in open() argument
226 let file: File = File::new(vcpu_inode, FileMode::O_RDWR)?; in kvm_vm_ioctl_create_vcpu()
H A Dvcpu_dev.rs7 core::generate_inode_id, file::FileMode, FilePrivateData, FileSystem, FileType, IndexNode,
104 _mode: &FileMode, in open() argument
/DragonOS/kernel/src/perf/
H A Dmod.rs5 use crate::filesystem::vfs::file::{File, FileMode, PageCache};
110 fn open(&self, _data: SpinLockGuard<FilePrivateData>, _mode: &FileMode) -> Result<()> { in open()
275 FileMode::O_RDWR | FileMode::O_CLOEXEC in perf_event_open()
277 FileMode::O_RDWR in perf_event_open()
/DragonOS/kernel/src/filesystem/devfs/
H A Dnull_dev.rs2 use crate::filesystem::vfs::file::FileMode;
78 _mode: &FileMode, in open() argument
H A Dzero_dev.rs2 use crate::filesystem::vfs::file::FileMode;
78 _mode: &FileMode, in open() argument
/DragonOS/kernel/src/driver/disk/ahci/
H A Dahci_inode.rs4 use crate::filesystem::vfs::file::FileMode;
83 _mode: &FileMode, in open() argument
/DragonOS/kernel/src/bpf/map/
H A Dmod.rs11 use crate::filesystem::vfs::file::{File, FileMode};
135 fn open(&self, _data: SpinLockGuard<FilePrivateData>, _mode: &FileMode) -> Result<()> { in open()
245 let file = File::new(Arc::new(bpf_map), FileMode::O_RDWR | FileMode::O_CLOEXEC)?; in bpf_map_create()
/DragonOS/kernel/src/driver/keyboard/
H A Dps2_keyboard.rs25 core::generate_inode_id, file::FileMode, syscall::ModeType, FilePrivateData,
140 _mode: &FileMode, in open() argument
/DragonOS/kernel/src/driver/tty/
H A Dtty_device.rs29 vfs::{file::FileMode, syscall::ModeType, FilePrivateData, FileType, IndexNode, Metadata},
139 mode: &crate::filesystem::vfs::file::FileMode, in open() argument
170 if !(mode.contains(FileMode::O_NOCTTY) && dev_num == DeviceNumber::new(Major::TTY_MAJOR, 0) in open()
586 pub mode: FileMode,
/DragonOS/kernel/src/driver/tty/pty/
H A Dunix98pty.rs14 file::FileMode, syscall::ModeType, FilePrivateData, FileType, MountFS, ROOT_INODE,
251 mode: &FileMode, in ptmx_open() argument

12