匿名管道重构&增加IrqArch trait以及IrqFlags及其守卫 (#253)

* 实现匿名管道

* 增加IrqArch trait以及IrqFlags及其守卫

---------

Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
hanjiezhou
2023-04-23 21:05:10 +08:00
committed by GitHub
parent 8a1e95abb5
commit f678331a33
14 changed files with 508 additions and 43 deletions

View File

@ -16,8 +16,3 @@ int mstat(struct mstat_t *stat)
{
return syscall_invoke(SYS_MSTAT, (uint64_t)stat, 0, 0, 0, 0, 0, 0, 0);
}
int pipe(int *fd)
{
return syscall_invoke(SYS_PIPE, (uint64_t)fd, 0, 0,0,0,0,0,0);
}

View File

@ -65,7 +65,14 @@ pid_t fork(void)
{
return (pid_t)syscall_invoke(SYS_FORK, 0, 0, 0, 0, 0, 0, 0, 0);
}
/**
* @brief 调用匿名管道
*
* @return int 如果失败返回负数
*/
int pipe(int fd[2]){
return (int)syscall_invoke(SYS_PIPE, fd, 0, 0, 0, 0, 0, 0, 0);
}
/**
* @brief fork当前进程但是与父进程共享VM、flags、fd
*