git: 9front

Download patch

ref: b94dfaaaab3574dff6ada00297eeb189b43fd672
parent: 924510aeb296c3db542d789aecc971f65eb45ef0
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 25 14:08:49 EST 2026

libc: initialize privalloc memory to zero

without this, it's very hard to use privalloc correctly.

--- a/sys/src/ape/lib/ap/plan9/callmain.c
+++ b/sys/src/ape/lib/ap/plan9/callmain.c
@@ -23,6 +23,7 @@
 	char err[ERRMAX];
 	void *privates[NPRIVATES];
 
+	memset(privates, 0, sizeof(privates));
 	err[0] = '\0';
 	_privates = privates;
 	_nprivates = NPRIVATES;
--- a/sys/src/libc/9sys/callmain.c
+++ b/sys/src/libc/9sys/callmain.c
@@ -15,6 +15,7 @@
 {
 	void *privates[NPRIVATES];
 
+	memset(privates, 0, sizeof(privates));
 	_privates = privates;
 	_nprivates = NPRIVATES;
 	main(argc, &arg0);
--