From 86f2a9067bcfedbe7b9cee87ab99816329929717 Mon Sep 17 00:00:00 2001 From: "bgerofi@riken.jp" Date: Thu, 4 Dec 2014 16:44:36 +0900 Subject: [PATCH] getppid() implementation --- arch/x86/kernel/include/syscall_list.h | 2 +- kernel/syscall.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/include/syscall_list.h b/arch/x86/kernel/include/syscall_list.h index 7f95a451..4d1ca6a1 100644 --- a/arch/x86/kernel/include/syscall_list.h +++ b/arch/x86/kernel/include/syscall_list.h @@ -63,7 +63,7 @@ SYSCALL_DELEGATED(104, getgid) SYSCALL_DELEGATED(107, geteuid) SYSCALL_DELEGATED(108, getegid) SYSCALL_HANDLED(109, setpgid) -SYSCALL_DELEGATED(110, getppid) +SYSCALL_HANDLED(110, getppid) SYSCALL_DELEGATED(111, getpgrp) SYSCALL_HANDLED(127, rt_sigpending) SYSCALL_HANDLED(128, rt_sigtimedwait) diff --git a/kernel/syscall.c b/kernel/syscall.c index 7006966a..d00b8402 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -1348,6 +1348,11 @@ SYSCALL_DECLARE(getpid) return cpu_local_var(current)->ftn->pid; } +SYSCALL_DECLARE(getppid) +{ + return cpu_local_var(current)->ftn->parent->pid; +} + void settid(struct process *proc, int mode, int newcpuid, int oldcpuid) {