The ChorusOS operating
system provides a /proc
file system derived from
the FreeBSD 4.1 implementation of /proc
. Due to major
differences in the implementation of the two systems, only a subset of the
FreeBSD /proc
file system has been retained. However,
due to enhancements of the process model introduced by the ChorusOS operating
system, such as the support of multi-threaded processes, extensions have been
introduced to reflect the multi-threaded nature of the processes.
Such a file system is usually mounted, by convention, under the /proc
directory. This directory is then populated and depopulated
dynamically and automatically depending on the life cycle of the processes.
ChorusOS actors are not reflected in this file system. Upon process creation
(using fork() or posix_spawn()) an entry
whose name is derived from the process identifier is created in the /proc
directory. This per-process entry is in turn a directory
whose layout is almost identical from one process to another. Threads running
in this process are also represented by a regular file in the /proc
file system (on a basis of one-to-one correspondence).
The API supported by the PROCFS file system are similar to those exported by the UFS file system, although many of calls that do not have any significance when applied to a process will return with an error code. The list of entries that are supported below each process are listed in the following table.
Entry |
Description |
---|---|
/proc |
Mount point |
/proc/curproc |
Symbolic link to the current process |
/proc/xxx |
Per-process directory (where xxx is the PID of the process) |
/proc/xxx/file |
Symbolic link to the executable file |
/proc/xxx/stats |
Per-process instrumentation |
/proc/xxx/status |
Process status information mostly used by ps(1) |
/proc/xxx/threads/ |
Process threads directory |
/proc/xxx/threads/tt |
Per-thread directory (where tt is the id of the thread) |
/proc/xxx/threads/tt/stats |
Per-thread instrumentation |