From 20dd16542c729d3e0c11d0e3fd7ba8554d054298 Mon Sep 17 00:00:00 2001 From: vasilito Date: Fri, 10 Jul 2026 16:13:15 +0300 Subject: [PATCH] syscall: add SYS_SETNS syscall number Red Bear OS needs SYS_SETNS for the init process to enter a null namespace before its waitpid loop (used by redox_setrens_v1). SYS_MKNS was already defined; this adds the matching SETNS. --- src/number.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/number.rs b/src/number.rs index 6b395b0707..f2ffd222c6 100644 --- a/src/number.rs +++ b/src/number.rs @@ -42,6 +42,11 @@ pub const SYS_FTRUNCATE: usize = SYS_CLASS_FILE | 0x1B3; pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | 0x1B4; pub const SYS_FSTATVFS: usize = SYS_CLASS_FILE | 0x1B5; pub const SYS_MKNS: usize = SYS_CLASS_FILE | 0x1B6; +/// Red Bear: set current namespace to the one referenced by `fd`. +/// `SYS_SETNS = SYS_CLASS_FILE | 0x1B7`. Pairs with `SYS_MKNS` for the +/// `redox_setrens_v1` / `redox-rt::sys::mkns` + `setns` pair that init uses +/// to enter a "null namespace" before its waitpid loop. +pub const SYS_SETNS: usize = SYS_CLASS_FILE | 0x1B7; // SYS_CALL, fd, inout buf ptr, inout buf len, flags, metadata buf ptr, metadata buf len // TODO: new number for SYS_CALL where flags are sent as 6th argument (using syscall6)