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/shared/printf.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src/shared')

diff --git a/src/shared/printf.c b/src/shared/printf.c
index 514b73e..fffd801 100644
--- a/src/shared/printf.c
+++ b/src/shared/printf.c
@@ -187,6 +187,7 @@ int __printf_internal(const char *fmt, va_list argp,
 			case 's':
 				const char *s = va_arg(argp, char*);
 				if (s == NULL) s = "(null)";
+				// TODO can segfault even if precision caps the string
 				len = strlen(s);
 				if (len > m.precision && m.precision != 0)
 					len = m.precision;
-- 
cgit v1.2.3