The Limbo system modules are as follows:
include "sys.m"; sys:= load Sys Sys->PATH;
When a process presents a file name to Inferno, it is evaluated by the following algorithm.
The collection of files reachable from the root is called the name space of a process.
The result of evaluating ".." in a union directory is undefined.
Certain conventions about the layout of the name space must be preserved.
File I/O
Files are opened for input or output by open or create (see open). These calls return a reference to an object of type FD (file descriptor) that identifies the file to subsequent I/O calls, notably read and write (see read). The FD contains an integer file descriptor, but the FD type is passed to Limbo I/O routines. When the last reference to an FD disappears, the file is descriptor is released by the garbage collector.
Integer file descriptor values range from 0 to n where the upper bound depends on the underlying operating system. The system allocates the numbers by selecting the lowest unused descriptor. They may be reassigned using dup (see dup). Integer file descriptor values are indices into a kernel-resident file descriptor table, which is inherited from the parent when a process is created by a Limbo spawn operation. A set of processes, called a file descriptor group, shares that table, so files opened by one process may be read and written by other processes in the group. (See pctl).
By convention, file descriptor 0 is the standard input, 1 is the standard output, and 2 is the standard error output. The operating system is unaware of these conventions. It is possible to close file 0, or even to replace it by a file open only for writing, but programs written according to the normal convention will be confused by such chicanery.
Directories may be opened and read much like regular files (see dirread). They contain an integral number of records, called directory entries. Each entry is a machine-independent representation of the information about an existing file in the directory, including the name, ownership, permission, access dates, and so on.
The entry corresponding to an arbitrary file can be retrieved by stat or fstat (see stat); wstat and fwstat write back entries, thus changing the properties of a file.
New files are made with create and deleted with remove (see open and remove).
Directories are manipulated by create, remove, wstat, and fwstat; they may not directly be written.
Process execution and control
A Limbo process, also called a thread, is the basic unit of computation for Limbo application programming in the Inferno system.
It is possible for a thread to acquire a new, independent name space and set of file descriptors. See pctl.
User/Group Identity
Inferno maintains user identifier (uid) and group identifier (gid) strings for each process. These values are also attributes of files and directories. See stat and stat. A comparison of process and file identities take place when a process attempts to open or create a file.
When a pathname crosses from one server to another the process identities are mapped by each server receiving a file request.