Procfs
Encyclopedia : P : PR : PRO : Procfs
- The correct title of this } is }}}. The initial letter is capitalized due to [Naming conventions #Lower case first lettertechnical restrictions].
The filesystem is often mounted at /proc. It is supported under Solaris, BSD and Linux, and the latter also extends it to non-process-related data.
History
The UNIX 8th Edition version of/proc was implemented by Tom J. Killian, who presented a paper titled Processes as Files at USENIX in June 1984. It was designed in order to replace the ptrace system call used for process tracing.
Roger Faulkner and Ron Gomes ported V8 /proc to SVR4, and published a paper called The Process File System and Process Model in UNIX System V at USENIX in January 1991. This kind of procfs supported the creation of ps, but the files could only be access with functions read(), write(), and ioctl().
Plan 9 implemented a process filesystem, but went further than V8. V8's process filesystem required operations applied to a single file for all functions related to a process. Plan 9 used separate files to provide those functions, and it made /proc a real part of the filesystem.
4.4BSD implemented /proc with subdirectories for each process, and the ability to access memory, registers, and current status. Solaris 2.6 /proc (finished in 1996) also had separate directory for each process, as well as a special ctl file which allowed for control, tracing and manipulation of processes.
Linux
Under Linux,/proc provides information on any running process at /proc/PID, but in addition to that it also includes:
- A symbolic link to the current (traversing) process at /proc/self
- Information on hardware, kernel, and module configuration
- Access to dynamically-configurable kernel options under /proc/sys
- Information about the system as a whole, such as
/proc/meminfo, which provides memory statistics.
The procfs plays an important role in moving functionality from kernel mode to user mode. For example the GNU version of ps operates entirely in user mode, using the procfs to obtain its data.
In kernel 2.6, much of the non-process related files under /proc were moved to a separate pseudo-filesystem called sysfs (mounted under /sys).
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
