mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-22 00:43:24 +00:00
Use ParentProcess to cache parent pid
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
f01772ca85
commit
787604b7f6
@ -4,9 +4,5 @@ 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 _)),
|
||||
}
|
||||
Ok(SyscallReturn::Return(ctx.process.parent().pid() as _))
|
||||
}
|
||||
|
Reference in New Issue
Block a user