The /proc directory contains a subdirectory for each
running process; the name of the subdirectory is the process
identifier (ID) number. The same information is available under
/dev/proc. Each process directory contains files that
describe the state of the process. Access to the files is
restricted to the owner or to a user with appropriate privileges.
These files are as follows:
as
Address space. This is a read/write file.
cmdline
The command line that invoked the process. Each argument is
terminated by a nul.
ctl
Control file. This control file is write-only. The following
control messages are defined in <sys/procfs>:
PCSTOP
Stop process cold.
PCRUN
Resume a stopped process.
PCWSTOP
Block until traced process stops on event of interest.
PCSTRACE
Set signal trace bits.
PCSFAULT
Set fault trace bits.
PCSENTRY
Set sysentry trace bits.
PCSEXIT
Set sysexit trace bits.
PCCFAULT
Clear current fault (if stopped on fault).
PCSREG
Set general registers.
PCSFPREG
Set floating point registers.
environ
The environment of the process.
map
Read-only map of the virtual memory address space.
psinfo
Contains miscellaneous information about the process and the
representative light-weight process (lwp) needed by the
ps(1) command. The psinfo process file is accessible
after a process becomes a zombie. The file contains a psinfo
structure (as defined in <sys/procfs.h>) that contains an
embedded lwpsinfo structure for the representative lwp.
stat
Human readable read-only status information. For example:
Binary status information. It corresponds to the System V r4.2
status file, and consists of a pstatus_t structure as
defined in <sys/procfs.h>. It is used by
gdb(1).
NOTE
The format of the contents of the proc directory as found
in the current release as well as any structures defined in
procfs.h and ucontext.h are not guaranteed to be
valid in future releases.