pub fn netns_available() -> boolExpand description
Whether an unprivileged, self-contained network namespace cut-off is
available on THIS process’s kernel — a real probe, but one that (unlike
landlock_available) genuinely can’t be done risk-free in the calling
process itself (unshare(2) acts on the CALLING process/thread, so
probing it directly would isolate supercode’s own network, not just
check availability). Instead this forks a disposable, single-purpose
child that does nothing but attempt the unshare and immediately
_exit() with the result — never touches the allocator, locks, or any
other state the parent might hold mid-fork (the standard safe shape for
a post-fork child that never execs), so it carries none of pre_exec’s
usual multi-threaded-fork hazards. Cached for the process lifetime.