3 ms·
What does "operating on the namespace" mean?
by drothlis 15y ago
What does "operating on the namespace" mean?
- 4ad 15y agoTo do any kind of I/O you just open a file from that process namespace using a set of standard system calls. It doesn't matter what resource you're accessing (regular file, network, window on the screen, window on someone else's screen, etc), the interface to do so is the same. Compare that to using specialized APIs for different type of I/O, for example using the socket API to do networking, or to use special X libraries to do graphics programming, or to hide another API inside ioctl(2). Namespaces in Plan9 are not global, each process has a private namespace (though many processes share most of it) allowing the composition of interfaces. (/dev/tty in Unix is different for each process as well). Each graphics program on Plan9 writes to /dev/draw and reads from /dev/mouse and /dev/console, but those are synthetic files implemented by the window manager by multiplexing the framebuffer, mouse and console. As you can see even though the files are synthetized the names in the namespace are the same because namespaces are private for each application and the window manager binds the synthetic files to those names. /edit: Ah, and one more thing, file-based I/O means shell scripts can do everything a compiled program could do, like networking.