Moving namespace functionality to userspace
We can move namespace functionality to relibc (while obviously preserving security). The kernel root scheme will be replaced by a scheme that only gives out anonymous scheme sockets. Userspace will implement :
instead, as a scheme where namespaces are file descriptors, and where the usual open(":name")
registers that name and fd-forwards the kernel-provided anonymous fd. FD forwarding will also allow insertion and removal of schemes from namespaces, with great flexibility.
Relibc will have a global variable called ACTIVE_NS, containing a namespace fd, and possibly more namespace fds as well. This eliminates getens/getrns/setrens/makens. Prefixes would be parsed in relibc's open(3), scheme access would be obtained through openat(ns, scheme_name) (possibly cached) and openat(scheme_access, path) would do the rest. The idea is that both ns and scheme access will be fd-based "capabilities".
This would require SYS_OPENAT to be implemented, and the libredox migration (libredox#1 (closed)) needs to be completed first (because this will break syscall::open
).