Add vfork syscall and related clone flags

This commit is contained in:
le-monde-bleu
2025-02-19 17:06:05 +08:00
committed by Jianfeng Jiang
parent 9a974a0483
commit 43e43ca133
3 changed files with 18 additions and 2 deletions

View File

@ -137,6 +137,14 @@ impl CloneArgs {
..Default::default()
}
}
pub fn for_vfork() -> Self {
Self {
flags: CloneFlags::CLONE_VFORK | CloneFlags::CLONE_VM,
exit_signal: Some(SIGCHLD),
..Default::default()
}
}
}
impl From<u64> for CloneFlags {
@ -158,7 +166,8 @@ impl CloneFlags {
| CloneFlags::CLONE_SETTLS
| CloneFlags::CLONE_PARENT_SETTID
| CloneFlags::CLONE_CHILD_SETTID
| CloneFlags::CLONE_CHILD_CLEARTID;
| CloneFlags::CLONE_CHILD_CLEARTID
| CloneFlags::CLONE_VFORK;
let unsupported_flags = *self - supported_flags;
if !unsupported_flags.is_empty() {
warn!("contains unsupported clone flags: {:?}", unsupported_flags);