Open utterances-bot opened 2 years ago
pub fn sys_openat(dirfd: usize, path: &str, flags: u32, mode: u32) -> isize {
syscall6(
SYSCALL_OPENAT, [dirfd, path.as_ptr() as usize, flags as usize, mode as usize, 0, 0]
)
}
syscall6()
syscall()
pub fn sys_openat(dirfd: usize, path: &str, flags: u32, mode: u32) -> isize {
syscall6(
SYSCALL_OPENAT, [dirfd, path.as_ptr() as usize, flags as usize, mode as usize, 0, 0]
)
}
应该改成这样?
pub fn sys_open(path: &str, flags: u32) -> isize {
syscall(SYSCALL_OPEN, [path.as_ptr() as usize, flags as usize, 0])
}
在打开文件,对文件完成了读写操作后,还需要关闭文件,这样才让进程释放杯这个文件所占用的内核资源。
杯 -> 被
在打开文件,对文件完成了读写操作后,还需要关闭文件,这样才让进程释放杯这个文件所占用的内核资源。
杯 -> 被
已经修改。谢谢!
pub fn sys_openat(dirfd: usize, path: &str, flags: u32, mode: u32) -> isize { syscall6( SYSCALL_OPENAT, [dirfd, path.as_ptr() as usize, flags as usize, mode as usize, 0, 0] ) }
~syscall6()~ syscall()
已经修改。谢谢!
pub fn sys_openat(dirfd: usize, path: &str, flags: u32, mode: u32) -> isize { syscall6( SYSCALL_OPENAT, [dirfd, path.as_ptr() as usize, flags as usize, mode as usize, 0, 0] ) }
应该改成这样?
pub fn sys_open(path: &str, flags: u32) -> isize { syscall(SYSCALL_OPEN, [path.as_ptr() as usize, flags as usize, 0]) }
已经修改。谢谢!
关于文件夹的权限,可以参考 https://unix.stackexchange.com/a/21263 。
文件系统接口 — rCore-Tutorial-Book-v3 3.6.0-alpha.1 文档
https://rcore-os.github.io/rCore-Tutorial-Book-v3/chapter6/1fs-interface.html