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/kernel/syscalls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kernel/syscalls.c') diff --git a/src/kernel/syscalls.c b/src/kernel/syscalls.c index 0810720..589098b 100644 --- a/src/kernel/syscalls.c +++ b/src/kernel/syscalls.c @@ -74,7 +74,7 @@ long _sys_fork(int flags, hid_t __user *fs_front) { pcpy_to(proc_cur, fs_front, &hid, sizeof hid); } } - SYSCALL_RETURN(child->cid); + SYSCALL_RETURN(proc_ns_id(proc_cur->pns, child)); } hid_t _sys_open(const char __user *path, long len, int flags) { -- cgit v1.2.3