From 78cb60b644538a33e0479f25393d6c861e3605f8 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 4 Jun 2023 20:43:51 +0200 Subject: kernel: rework /proc/ and process IDs I'm yet to write proper docs but the TL;DR is: Mounting /proc/ creates a new pid namespace. You're still visible in the old namespace with your old pid, but your children won't be. You see your own pid as 1. Current pids of children will be preserved, pids will be allocated starting from the highest one of your children. --- src/user/app/shell/shell.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/user/app/shell/shell.c') diff --git a/src/user/app/shell/shell.c b/src/user/app/shell/shell.c index d2d7e37..becc8d8 100644 --- a/src/user/app/shell/shell.c +++ b/src/user/app/shell/shell.c @@ -58,10 +58,14 @@ void run_args(int argc, char **argv, struct redir *redir) { return; } _sys_mount(HANDLE_PROCFS, argv[1], strlen(argv[1])); - if (!fork2_n_mount("/")) { - fs_dir_inject(argv[1]); - exit(1); + /* + if (!(3 <= argc && !strcmp(argv[2], "raw"))) { + if (!fork2_n_mount("/")) { + fs_dir_inject(argv[1]); + exit(1); + } } + */ return; } else if (!strcmp(argv[0], "cd")) { if (chdir(argc > 1 ? argv[1] : "/") < 0) -- cgit v1.2.3