1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1994-08-10 20:03:06 +00:00
|
|
|
.\" Written by Garrett Wollman
|
|
|
|
.\" This file is in the public domain.
|
|
|
|
.\"
|
2017-03-05 03:05:24 +00:00
|
|
|
.Dd March 4, 2017
|
1994-08-10 20:03:06 +00:00
|
|
|
.Dt PROCFS 5
|
2001-07-10 15:31:11 +00:00
|
|
|
.Os
|
1994-08-10 20:03:06 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm procfs
|
2002-12-12 17:26:04 +00:00
|
|
|
.Nd process file system
|
1994-08-10 20:03:06 +00:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Bd -literal
|
|
|
|
proc /proc procfs rw 0 0
|
1994-08-10 20:03:54 +00:00
|
|
|
.Ed
|
1994-08-10 20:03:06 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-12-12 17:26:04 +00:00
|
|
|
The process file system, or
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm ,
|
2002-12-12 17:26:04 +00:00
|
|
|
implements a view of the system process table inside the file system.
|
1994-08-10 20:03:06 +00:00
|
|
|
It is normally mounted on
|
2015-12-26 14:23:35 +00:00
|
|
|
.Pa /proc .
|
1994-08-10 20:03:06 +00:00
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
provides a two-level view of process space, unlike the previous
|
|
|
|
.Fx 1.1
|
|
|
|
.Nm
|
|
|
|
implementation.
|
|
|
|
At the highest level, processes themselves are named, according to
|
2004-07-03 18:29:24 +00:00
|
|
|
their process ids in decimal, with no leading zeros.
|
|
|
|
There is also a
|
1994-08-10 20:03:06 +00:00
|
|
|
special node called
|
|
|
|
.Pa curproc
|
|
|
|
which always refers to the process making the lookup request.
|
|
|
|
.Pp
|
|
|
|
Each node is a directory which contains the following entries:
|
1996-12-14 20:11:57 +00:00
|
|
|
.Bl -tag -width status
|
2000-02-12 18:33:54 +00:00
|
|
|
.It Pa dbregs
|
|
|
|
The debug registers as defined by
|
|
|
|
.Dv "struct dbregs"
|
|
|
|
in
|
2003-09-10 19:24:35 +00:00
|
|
|
.In machine/reg.h .
|
2000-02-12 18:33:54 +00:00
|
|
|
.Pa dbregs
|
|
|
|
is currently only implemented on the i386 architecture.
|
1996-12-14 19:09:58 +00:00
|
|
|
.It Pa etype
|
1996-12-14 20:11:57 +00:00
|
|
|
The type of the executable referenced by the
|
|
|
|
.Pa file
|
|
|
|
entry.
|
1996-12-14 19:09:58 +00:00
|
|
|
.It Pa file
|
2000-04-22 18:19:54 +00:00
|
|
|
A symbolic link to the file from which the process text was read.
|
1996-12-14 20:11:57 +00:00
|
|
|
This can be used to gain access to the process' symbol table,
|
|
|
|
or to start another copy of the process.
|
2000-04-22 18:19:54 +00:00
|
|
|
If the file cannot be found, the link target is
|
|
|
|
.Ql unknown .
|
1996-12-14 19:09:58 +00:00
|
|
|
.It Pa fpregs
|
1996-12-14 20:11:57 +00:00
|
|
|
The floating point registers as defined by
|
|
|
|
.Dv "struct fpregs"
|
|
|
|
in
|
2003-09-10 19:24:35 +00:00
|
|
|
.In machine/reg.h .
|
1996-12-14 20:11:57 +00:00
|
|
|
.Pa fpregs
|
|
|
|
is only implemented on machines which have distinct general
|
|
|
|
purpose and floating point register sets.
|
1996-12-14 19:09:58 +00:00
|
|
|
.It Pa map
|
1996-12-14 20:11:57 +00:00
|
|
|
A map of the process' virtual memory.
|
1994-08-10 20:03:06 +00:00
|
|
|
.It Pa mem
|
1996-12-14 20:11:57 +00:00
|
|
|
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.
|
1994-08-10 20:03:06 +00:00
|
|
|
.It Pa note
|
2004-07-03 18:29:24 +00:00
|
|
|
Used for sending signals to the process.
|
|
|
|
Not implemented.
|
1994-08-10 20:03:06 +00:00
|
|
|
.It Pa notepg
|
2004-07-03 18:29:24 +00:00
|
|
|
Used for sending signal to the process group.
|
|
|
|
Not implemented.
|
2009-09-23 12:10:13 +00:00
|
|
|
.It Pa osrel
|
|
|
|
Allows read and write of the kernel osrel value assigned to the process.
|
|
|
|
It affects the compatibility shims that are turned on and off
|
|
|
|
depending on the value.
|
|
|
|
Initial process value is read from the ABI note tag in the executed ELF image,
|
|
|
|
and is zero if the tag not supported by binary format or was not found.
|
1994-08-10 20:03:06 +00:00
|
|
|
.It Pa regs
|
1996-12-14 20:11:57 +00:00
|
|
|
Allows read and write access to the process' register set.
|
|
|
|
This file contains a binary data structure
|
|
|
|
.Dv "struct regs"
|
|
|
|
defined in
|
2003-09-10 19:24:35 +00:00
|
|
|
.In machine/reg.h .
|
1996-12-14 20:11:57 +00:00
|
|
|
.Pa regs
|
|
|
|
can only be written when the process is stopped.
|
1999-04-30 13:04:21 +00:00
|
|
|
.It Pa rlimit
|
|
|
|
This is a read-only file containing the process current and maximum
|
2000-03-03 14:05:08 +00:00
|
|
|
limits.
|
2001-07-14 19:41:16 +00:00
|
|
|
Each line is of the format
|
2001-08-10 17:35:21 +00:00
|
|
|
.Ar rlimit current max ,
|
|
|
|
with -1
|
1999-04-30 13:04:21 +00:00
|
|
|
indicating infinity.
|
1996-12-14 19:09:58 +00:00
|
|
|
.It Pa status
|
1996-12-14 20:11:57 +00:00
|
|
|
The process status.
|
|
|
|
This file is read-only and returns a single line containing
|
|
|
|
multiple space-separated fields as follows:
|
|
|
|
.Pp
|
|
|
|
.Bl -bullet -compact
|
|
|
|
.It
|
|
|
|
command name
|
|
|
|
.It
|
|
|
|
process id
|
|
|
|
.It
|
|
|
|
parent process id
|
|
|
|
.It
|
|
|
|
process group id
|
|
|
|
.It
|
|
|
|
session id
|
|
|
|
.It
|
2013-04-22 20:14:57 +00:00
|
|
|
device name
|
1996-12-14 20:11:57 +00:00
|
|
|
of the controlling terminal, or
|
2013-04-22 20:14:57 +00:00
|
|
|
a minus sign
|
|
|
|
.Pq Dq -
|
1996-12-14 20:11:57 +00:00
|
|
|
if there is no controlling terminal.
|
|
|
|
.It
|
|
|
|
a list of process flags:
|
|
|
|
.Dv ctty
|
|
|
|
if there is a controlling terminal,
|
|
|
|
.Dv sldr
|
|
|
|
if the process is a session leader,
|
|
|
|
.Dv noflags
|
|
|
|
if neither of the other two flags are set.
|
|
|
|
.It
|
|
|
|
the process start time in seconds and microseconds,
|
|
|
|
comma separated.
|
|
|
|
.It
|
|
|
|
the user time in seconds and microseconds,
|
|
|
|
comma separated.
|
|
|
|
.It
|
|
|
|
the system time in seconds and microseconds,
|
|
|
|
comma separated.
|
|
|
|
.It
|
|
|
|
the wait channel message
|
|
|
|
.It
|
|
|
|
the process credentials consisting of
|
|
|
|
the effective user id
|
|
|
|
and the list of groups (whose first member
|
|
|
|
is the effective group id)
|
|
|
|
all comma separated.
|
2003-05-09 09:20:26 +00:00
|
|
|
.It
|
|
|
|
the hostname of the jail in which the process runs, or
|
2003-05-21 15:49:01 +00:00
|
|
|
.Ql -
|
2003-05-09 09:20:26 +00:00
|
|
|
to indicate that the process is not running within a jail.
|
1994-08-10 20:03:06 +00:00
|
|
|
.El
|
1996-12-14 20:11:57 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
1994-08-10 20:03:06 +00:00
|
|
|
Each node is owned by the process's user, and belongs to that user's
|
2017-03-05 03:05:24 +00:00
|
|
|
primary group.
|
1994-08-10 20:03:06 +00:00
|
|
|
.Sh FILES
|
1996-12-14 20:11:57 +00:00
|
|
|
.Bl -tag -width /proc/curproc/XXXXXXX -compact
|
1994-08-10 20:03:06 +00:00
|
|
|
.It Pa /proc
|
|
|
|
normal mount point for the
|
2000-11-20 18:41:33 +00:00
|
|
|
.Nm .
|
1996-12-14 20:11:57 +00:00
|
|
|
.It Pa /proc/pid
|
2001-07-14 19:41:16 +00:00
|
|
|
directory containing process information for process
|
1996-12-14 20:11:57 +00:00
|
|
|
.Pa pid .
|
|
|
|
.It Pa /proc/curproc
|
|
|
|
directory containing process information for the current process
|
1999-04-30 13:04:21 +00:00
|
|
|
.It Pa /proc/curproc/cmdline
|
|
|
|
the process executable name
|
1996-12-14 20:11:57 +00:00
|
|
|
.It Pa /proc/curproc/etype
|
|
|
|
executable type
|
|
|
|
.It Pa /proc/curproc/file
|
|
|
|
executable image
|
|
|
|
.It Pa /proc/curproc/fpregs
|
|
|
|
the process floating point register set
|
|
|
|
.It Pa /proc/curproc/map
|
|
|
|
virtual memory map of the process
|
|
|
|
.It Pa /proc/curproc/mem
|
|
|
|
the complete virtual address space of the process
|
|
|
|
.It Pa /proc/curproc/note
|
|
|
|
used for signaling the process
|
|
|
|
.It Pa /proc/curproc/notepg
|
|
|
|
used for signaling the process group
|
2009-09-23 12:10:13 +00:00
|
|
|
.It Pa /proc/curproc/osrel
|
|
|
|
the process osrel value
|
1996-12-14 20:11:57 +00:00
|
|
|
.It Pa /proc/curproc/regs
|
|
|
|
the process register set
|
1999-04-30 13:04:21 +00:00
|
|
|
.It Pa /proc/curproc/rlimit
|
|
|
|
the process current and maximum rlimit
|
1996-12-14 20:11:57 +00:00
|
|
|
.It Pa /proc/curproc/status
|
|
|
|
the process' current status
|
1994-08-10 20:03:06 +00:00
|
|
|
.El
|
2006-05-19 00:23:29 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
To mount a
|
|
|
|
.Nm
|
|
|
|
file system on
|
|
|
|
.Pa /proc :
|
|
|
|
.Pp
|
|
|
|
.Dl "mount -t procfs proc /proc"
|
1996-12-14 20:11:57 +00:00
|
|
|
.Sh SEE ALSO
|
2009-07-09 16:40:00 +00:00
|
|
|
.Xr procstat 1 ,
|
1996-12-14 20:11:57 +00:00
|
|
|
.Xr mount 2 ,
|
1996-12-26 02:02:31 +00:00
|
|
|
.Xr sigaction 2 ,
|
1996-12-14 20:11:57 +00:00
|
|
|
.Xr unmount 2 ,
|
2001-12-08 16:43:24 +00:00
|
|
|
.Xr pseudofs 9
|
1998-03-12 07:31:21 +00:00
|
|
|
.Sh AUTHORS
|
2000-11-22 09:35:58 +00:00
|
|
|
.An -nosplit
|
1998-03-12 07:31:21 +00:00
|
|
|
This manual page written by
|
|
|
|
.An Garrett Wollman ,
|
|
|
|
based on the description
|
|
|
|
provided by
|
|
|
|
.An Jan-Simon Pendry ,
|
|
|
|
and revamped later by
|
|
|
|
.An Mike Pritchard .
|