修复pipe2在读端或写端关闭后还阻塞问题 (#396)

* 修复pipe2在读端或写端关闭后还阻塞问题。

* update

* update

* 修改cloexec

---------

Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
GnoCiYeH
2023-10-03 12:03:34 +08:00
committed by GitHub
parent fba5623183
commit 876cb89ecf
6 changed files with 166 additions and 15 deletions

View File

@ -61,7 +61,13 @@ impl Syscall {
.basic_mut()
.set_name(ProcessControlBlock::generate_name(&path, &argv));
return Self::do_execve(path, argv, envp, frame);
Self::do_execve(path, argv, envp, frame)?;
// 关闭设置了O_CLOEXEC的文件描述符
let fd_table = ProcessManager::current_pcb().fd_table();
fd_table.write().close_on_exec();
return Ok(());
}
pub fn wait4(