diff options
author | dzwdz | 2023-06-10 16:26:46 +0200 |
---|---|---|
committer | dzwdz | 2023-06-10 16:26:46 +0200 |
commit | b09263bd64b3408cbd109dacc4b7618d22b02248 (patch) | |
tree | e461c86fdf229670451f657ef83dd1e2ac802bba /src/user/app | |
parent | 112eafe13c3628cad6e692179c064dbbc3be2d8b (diff) |
kernel: implement getpid, getppid
Diffstat (limited to 'src/user/app')
-rw-r--r-- | src/user/app/shell/shell.c | 3 |
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()) { |