summaryrefslogtreecommitdiff
path: root/src/user/app/shell
diff options
context:
space:
mode:
authordzwdz2023-06-10 16:26:46 +0200
committerdzwdz2023-06-10 16:26:46 +0200
commitb09263bd64b3408cbd109dacc4b7618d22b02248 (patch)
treee461c86fdf229670451f657ef83dd1e2ac802bba /src/user/app/shell
parent112eafe13c3628cad6e692179c064dbbc3be2d8b (diff)
kernel: implement getpid, getppid
Diffstat (limited to 'src/user/app/shell')
-rw-r--r--src/user/app/shell/shell.c3
1 files changed, 3 insertions, 0 deletions
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()) {