]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man5/procfs.5
sysctl(9): Fix a few mandoc related issues
[FreeBSD/FreeBSD.git] / share / man / man5 / procfs.5
1 .\" $FreeBSD$
2 .\" Written by Garrett Wollman
3 .\" This file is in the public domain.
4 .\"
5 .Dd March 4, 2017
6 .Dt PROCFS 5
7 .Os
8 .Sh NAME
9 .Nm procfs
10 .Nd process file system
11 .Sh SYNOPSIS
12 .Bd -literal
13 proc            /proc   procfs  rw 0 0
14 .Ed
15 .Sh DESCRIPTION
16 The process file system, or
17 .Nm ,
18 implements a view of the system process table inside the file system.
19 It is normally mounted on
20 .Pa /proc .
21 .Pp
22 The
23 .Nm
24 provides a two-level view of process space, unlike the previous
25 .Fx 1.1
26 .Nm
27 implementation.
28 At the highest level, processes themselves are named, according to
29 their process ids in decimal, with no leading zeros.
30 There is also a
31 special node called
32 .Pa curproc
33 which always refers to the process making the lookup request.
34 .Pp
35 Each node is a directory which contains the following entries:
36 .Bl -tag -width status
37 .It Pa dbregs
38 The debug registers as defined by
39 .Dv "struct dbregs"
40 in
41 .In machine/reg.h .
42 .Pa dbregs
43 is currently only implemented on the i386 architecture.
44 .It Pa etype
45 The type of the executable referenced by the
46 .Pa file
47 entry.
48 .It Pa file
49 A symbolic link to the file from which the process text was read.
50 This can be used to gain access to the process' symbol table,
51 or to start another copy of the process.
52 If the file cannot be found, the link target is
53 .Ql unknown .
54 .It Pa fpregs
55 The floating point registers as defined by
56 .Dv "struct fpregs"
57 in
58 .In machine/reg.h .
59 .Pa fpregs
60 is only implemented on machines which have distinct general
61 purpose and floating point register sets.
62 .It Pa map
63 A map of the process' virtual memory.
64 .It Pa mem
65 The complete virtual memory image of the process.
66 Only those address which exist in the process can be accessed.
67 Reads and writes to this file modify the process.
68 Writes to the text segment remain private to the process.
69 .It Pa note
70 Used for sending signals to the process.
71 Not implemented.
72 .It Pa notepg
73 Used for sending signal to the process group.
74 Not implemented.
75 .It Pa osrel
76 Allows read and write of the kernel osrel value assigned to the process.
77 It affects the compatibility shims that are turned on and off
78 depending on the value.
79 Initial process value is read from the ABI note tag in the executed ELF image,
80 and is zero if the tag not supported by binary format or was not found.
81 .It Pa regs
82 Allows read and write access to the process' register set.
83 This file contains a binary data structure
84 .Dv "struct regs"
85 defined in
86 .In machine/reg.h .
87 .Pa regs
88 can only be written when the process is stopped.
89 .It Pa rlimit
90 This is a read-only file containing the process current and maximum
91 limits.
92 Each line is of the format
93 .Ar rlimit current max ,
94 with -1
95 indicating infinity.
96 .It Pa status
97 The process status.
98 This file is read-only and returns a single line containing
99 multiple space-separated fields as follows:
100 .Pp
101 .Bl -bullet -compact
102 .It
103 command name
104 .It
105 process id
106 .It
107 parent process id
108 .It
109 process group id
110 .It
111 session id
112 .It
113 device name
114 of the controlling terminal, or
115 a minus sign
116 .Pq Dq -
117 if there is no controlling terminal.
118 .It
119 a list of process flags:
120 .Dv ctty
121 if there is a controlling terminal,
122 .Dv sldr
123 if the process is a session leader,
124 .Dv noflags
125 if neither of the other two flags are set.
126 .It
127 the process start time in seconds and microseconds,
128 comma separated.
129 .It
130 the user time in seconds and microseconds,
131 comma separated.
132 .It
133 the system time in seconds and microseconds,
134 comma separated.
135 .It
136 the wait channel message
137 .It
138 the process credentials consisting of
139 the effective user id
140 and the list of groups (whose first member
141 is the effective group id)
142 all comma separated.
143 .It
144 the hostname of the jail in which the process runs, or
145 .Ql -
146 to indicate that the process is not running within a jail.
147 .El
148 .El
149 .Pp
150 Each node is owned by the process's user, and belongs to that user's
151 primary group.
152 .Sh FILES
153 .Bl -tag -width /proc/curproc/XXXXXXX -compact
154 .It Pa /proc
155 normal mount point for the
156 .Nm .
157 .It Pa /proc/pid
158 directory containing process information for process
159 .Pa pid .
160 .It Pa /proc/curproc
161 directory containing process information for the current process
162 .It Pa /proc/curproc/cmdline
163 the process executable name
164 .It Pa /proc/curproc/etype
165 executable type
166 .It Pa /proc/curproc/file
167 executable image
168 .It Pa /proc/curproc/fpregs
169 the process floating point register set
170 .It Pa /proc/curproc/map
171 virtual memory map of the process
172 .It Pa /proc/curproc/mem
173 the complete virtual address space of the process
174 .It Pa /proc/curproc/note
175 used for signaling the process
176 .It Pa /proc/curproc/notepg
177 used for signaling the process group
178 .It Pa /proc/curproc/osrel
179 the process osrel value
180 .It Pa /proc/curproc/regs
181 the process register set
182 .It Pa /proc/curproc/rlimit
183 the process current and maximum rlimit
184 .It Pa /proc/curproc/status
185 the process' current status
186 .El
187 .Sh EXAMPLES
188 To mount a
189 .Nm
190 file system on
191 .Pa /proc :
192 .Pp
193 .Dl "mount -t procfs proc /proc"
194 .Sh SEE ALSO
195 .Xr procstat 1 ,
196 .Xr mount 2 ,
197 .Xr sigaction 2 ,
198 .Xr unmount 2 ,
199 .Xr pseudofs 9
200 .Sh AUTHORS
201 .An -nosplit
202 This manual page written by
203 .An Garrett Wollman ,
204 based on the description
205 provided by
206 .An Jan-Simon Pendry ,
207 and revamped later by
208 .An Mike Pritchard .