Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Maturin

一个内核。
xsp modified

## Doc

Expand Down
4 changes: 4 additions & 0 deletions kernel/src/syscall/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,10 @@ pub fn sys_close(fd: usize) -> SysResult {
/// 注意,因为
pub fn sys_pipe(pipe: *mut u32) -> SysResult {
let task = get_current_task().unwrap();
let mut task_vm = task.vm.lock();
if task_vm.manually_alloc_user_str(pipe as *const u8,2).is_err() {
return Err(ErrorNo::EFAULT); // 地址不合法
}
let mut task_fd_manager = task.fd_manager.lock();
let (pipe_read, pipe_write) = Pipe::new_pipe();
if let Ok(fd1) = task_fd_manager.push(Arc::new(pipe_read)) {
Expand Down