mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 00:43:24 +00:00
Remove the shim kernel crate
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
d76c7a5b1e
commit
dafd16075f
12
kernel/src/syscall/getppid.rs
Normal file
12
kernel/src/syscall/getppid.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use super::SyscallReturn;
|
||||
use crate::prelude::*;
|
||||
|
||||
pub fn sys_getppid(ctx: &Context) -> Result<SyscallReturn> {
|
||||
let parent = ctx.process.parent();
|
||||
match parent {
|
||||
None => Ok(SyscallReturn::Return(0)),
|
||||
Some(parent) => Ok(SyscallReturn::Return(parent.pid() as _)),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user