Skip to content
Merged
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
5 changes: 3 additions & 2 deletions kernel/src/process/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ impl Syscall {
) -> Result<usize, SystemError> {
let ret = unsafe { c_sys_wait4(pid, wstatus, options, rusage) };
if (ret as isize) < 0 {
return Err(SystemError::from_posix_errno(-(ret as isize) as i32)
.expect("wait4: Invalid errno"));
return Err(
SystemError::from_posix_errno((ret as isize) as i32).expect("wait4: Invalid errno")
);
}
return Ok(ret as usize);
}
Expand Down
6 changes: 6 additions & 0 deletions user/libs/libc/src/include/export/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ int rm(const char * path);
*/
void swab(void *restrict src, void *restrict dest, ssize_t nbytes);

/**
* @brief 创建pipe
* @param fildes 分别是读端fildes[0]和写端fildes[1]
*/
int pipe(int fildes[2]);

pid_t getpid(void);

int dup(int fd);
Expand Down