From b09263bd64b3408cbd109dacc4b7618d22b02248 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 10 Jun 2023 16:26:46 +0200 Subject: kernel: implement getpid, getppid --- src/user/app/shell/shell.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/user/app/shell') diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c index becc8d8..8e13029 100644 --- a/src/user/app/shell/shell.c +++ b/src/user/app/shell/shell.c @@ -80,6 +80,9 @@ void run_args(int argc, char **argv, struct redir *redir) { return; } else if (!strcmp(argv[0], "exit")) { exit(0); + } else if (!strcmp(argv[0], "getpid")) { + printf("my\t%d\nparent\t%d\n", getpid(), getppid()); + return; } if (fork()) { -- cgit v1.2.3