fix: inherit process environment and untrack libc objects

This commit is contained in:
2026-08-11 13:08:40 +02:00
parent 0a91131cb0
commit 3ef98a9fd5
26 changed files with 254 additions and 36 deletions
+3
View File
@@ -233,6 +233,9 @@ namespace montauk::abi {
static constexpr uint64_t SYS_MMAP_ANON = 168;
static constexpr uint64_t SYS_MUNMAP = 169;
static constexpr uint64_t SYS_MPROTECT = 170;
static constexpr uint64_t SYS_GETENVIRON = 171;
static constexpr uint64_t SYS_SETENVIRON = 172;
static constexpr uint64_t SYS_SPAWN_ENV = 173;
// Tunable parameters (for SYS_SDR_SETPARAM / SYS_SDR_GETPARAM).
static constexpr int SDR_PARAM_FREQ = 0; // center frequency, Hz
+3
View File
@@ -73,6 +73,9 @@ extern "C" {
#define MTK_SYS_MOUSESTATE 47
#define MTK_SYS_SETMOUSEBOUNDS 48
#define MTK_SYS_SPAWN_REDIR 49
#define MTK_SYS_GETENVIRON 171
#define MTK_SYS_SETENVIRON 172
#define MTK_SYS_SPAWN_ENV 173
#define MTK_SYS_CHILDIO_READ 50
#define MTK_SYS_CHILDIO_WRITE 51
#define MTK_SYS_CHILDIO_WRITEKEY 52
+1 -1
View File
@@ -15,7 +15,7 @@ extern "C" {
* Limitations (kernel spawn model):
* - argv is joined into a single args string; arguments containing
* spaces are rejected with EINVAL (no quoting in the kernel).
* - envp is ignored (no environment transfer on spawn).
* - envp is copied into the child; NULL inherits the current environment.
* - file actions must be empty: stdio redirection needs kernel
* support that does not exist yet, so any recorded action makes
* posix_spawn fail with ENOTSUP rather than misbehave silently.