.\" Copyright (c) 1992, 1993
.\" The Regents of the University of California. All rights reserved.
.\" This code is derived from software donated to Berkeley by
.\" %sccs.include.redist.roff%
.\" @(#)mount_procfs.8 8.1 (Berkeley) %G%
.Nd mount the process file system
command attaches an instance of the process
namespace to the global filesystem namespace.
The conventional mount point is
This command is normally executed by
The root of the process filesystem
contains an entry for each active process.
These processes are visible as a directory whose
name is the process' pid.
In addition, the special entry
references the current process.
Each directory contains several files.
a writeonly file which supports a variety
Control commands are written as strings to the
The control commands are:
.Bl -tag -width detach -compact
stops the target process and arranges for the sending
process to become the debug control process.
continue execution of the target process and
remove it from control by the debug process (which
need not be the sending process).
continue running the target process until
a signal is delivered, a breakpoint is hit, or the
single step the target process, with no signal delivery.
wait for the target process to come to a steady
state ready for debugging.
The target process must be in this state before
any of the other commands are allowed.
The string can also be the name of a signal, lower case
in which case that signal is delivered to the process
A reference to the vnode from which the process text was read.
This can be used to gain access to the process' symbol table,
or to start another copy of the process.
The complete virtual memory image of the process.
Only those address which exist in the process can be accessed.
Reads and writes to this file modify the process.
Writes to the text segment remain private to the process.
Allows read and write access to the process' register set.
This file contains a binary data structure
can only be written when the process is stopped.
The floating point registers as defined by
is only implemented on machines which have distinct general
purpose and floating point register sets.
This file is readonly and returns a single line containing
multiple space-separated fields as follows:
of the controlling terminal, or
if there is no controlling terminal.
if there is a controlling terminal,
if the process is a session leader,
if neither of the other two flags are set.
the process start time in seconds and microseconds,
the user time in seconds and microseconds,
the system time in seconds and microseconds,
the process credentials consisting of
and the list of groups (whose first member
is the effective group id)
In a normal debugging environment,
where the target is fork/exec'd by the debugger,
the debugger should fork and the child should stop
itself (with a self-inflicted
The parent should issue a
command via the appropriate
The child process will receive a
immediately after the call to exec (see
.Bl -tag -width /proc/curproc -compact
.It Pa /proc/curproc/file
.It Pa /proc/curproc/note
.It Pa /proc/curproc/notepg
.It Pa /proc/curproc/regs
.It Pa /proc/curproc/fpregs
.It Pa /proc/curproc/status
entries appear when listing the contents of the
This makes sense in the context of this filesystem, but is inconsistent
with usual filesystem conventions.
However, it is still possible to refer to both
This filesystem may not be NFS-exported
since most of the functionality of
requires that state be maintained.
utility first appeared in 4.4BSD.