mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 09:23:25 +00:00
Remove the shim kernel crate
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d76c7a5b1e
commit
dafd16075f
15
kernel/src/syscall/fork.rs
Normal file
15
kernel/src/syscall/fork.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use ostd::cpu::UserContext;
|
||||
|
||||
use super::SyscallReturn;
|
||||
use crate::{
|
||||
prelude::*,
|
||||
process::{clone_child, CloneArgs},
|
||||
};
|
||||
|
||||
pub fn sys_fork(ctx: &Context, parent_context: &UserContext) -> Result<SyscallReturn> {
|
||||
let clone_args = CloneArgs::for_fork();
|
||||
let child_pid = clone_child(ctx, parent_context, clone_args).unwrap();
|
||||
Ok(SyscallReturn::Return(child_pid as _))
|
||||
}
|
Reference in New Issue
Block a user