summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/procfs.4 3.html
blob: 8d08ccc5ba2ecc0fcc03a618714b296561338e26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<table class="head">
  <tr>
    <td class="head-ltitle">PROCFS(4)</td>
    <td class="head-vol">Device Drivers Manual</td>
    <td class="head-rtitle">PROCFS(4)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">procfs</code> &#x2014; <span class="Nd">process
    file system</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<div class="Bd Li">
<pre>proc		/proc	procfs	rw 0 0</pre>
</div>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<div class="Bf Sy">This functionality is deprecated. Users are advised to use
  <a class="Xr">libprocstat(3)</a> and <a class="Xr">kvm(3)</a> instead.</div>
<p class="Pp">The process file system, or <code class="Nm">procfs</code>,
    implements a view of the system process table inside the file system. It is
    normally mounted on <span class="Pa">/proc</span>.</p>
<p class="Pp">The <code class="Nm">procfs</code> provides a two-level view of
    process space, unlike the previous <span class="Ux">FreeBSD 1.1</span>
    <code class="Nm">procfs</code> implementation. At the highest level,
    processes themselves are named, according to their process ids in decimal,
    with no leading zeros. There is also a special node called
    <span class="Pa">curproc</span> which always refers to the process making
    the lookup request.</p>
<p class="Pp">Each node is a directory which contains the following entries:</p>
<dl class="Bl-tag">
  <dt><span class="Pa">dbregs</span></dt>
  <dd>The debug registers as defined by <code class="Dv">struct dbregs</code> in
      <code class="In">&lt;<a class="In">machine/reg.h</a>&gt;</code>.
      <span class="Pa">dbregs</span> is currently only implemented on the i386
      architecture.</dd>
  <dt><span class="Pa">etype</span></dt>
  <dd>The type of the executable referenced by the <span class="Pa">file</span>
      entry.</dd>
  <dt><span class="Pa">file</span></dt>
  <dd>A symbolic link to the file 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. If the file cannot be found, the link target is
      &#x2018;<code class="Li">unknown</code>&#x2019;.</dd>
  <dt><span class="Pa">fpregs</span></dt>
  <dd>The floating point registers as defined by <code class="Dv">struct
      fpregs</code> in
      <code class="In">&lt;<a class="In">machine/reg.h</a>&gt;</code>.
      <span class="Pa">fpregs</span> is only implemented on machines which have
      distinct general purpose and floating point register sets.</dd>
  <dt><span class="Pa">map</span></dt>
  <dd>A collection of lines describing the memory regions of the process, where
      each line contains the following fields:
    <dl class="Bl-tag Bl-compact">
      <dt>start-address</dt>
      <dd>The starting address for the region (inclusive).</dd>
      <dt>end-address</dt>
      <dd>The ending address for the region (exclusive).</dd>
      <dt>resident</dt>
      <dd>The number of resident pages.</dd>
      <dt>private-resident</dt>
      <dd>The number of resident pages that were private to the process.</dd>
      <dt>obj</dt>
      <dd>The virtual address of the <var class="Vt">struct vm_object</var>
          kernel data structure describing the memory region.</dd>
      <dt>access</dt>
      <dd>A three character string comprising the characters &#x2018;r&#x2019;,
          &#x2018;w&#x2019; and &#x2018;x&#x2019;, denoting read, write, and
          execute permissions respectively. The lack of a permission is
          represented by &#x2018;-&#x2019;.</dd>
      <dt>ref_count</dt>
      <dd>The number of references to the region.</dd>
      <dt>shadow_count</dt>
      <dd>The number of VM objects that this region is a shadow for.</dd>
      <dt id="OBJ_*">flags</dt>
      <dd>The flags for the object, see the flags named
          <a class="permalink" href="#OBJ_*"><b class="Sy">OBJ_*</b></a> in
          <code class="In">&lt;<a class="In">vm/vm_object.h</a>&gt;</code>.</dd>
      <dt>copy-on-write</dt>
      <dd>Whether the region is copy-on-write. One of:
        <dl class="Bl-tag Bl-compact">
          <dt>COW</dt>
          <dd>A copy-on-write region.</dd>
          <dt>NCOW</dt>
          <dd>A non-copy-on-write region.</dd>
        </dl>
      </dd>
      <dt>needs-copy</dt>
      <dd>Whether the region needs a copy. One of:
        <dl class="Bl-tag Bl-compact">
          <dt>NC</dt>
          <dd>The region needs a copy.</dd>
          <dt>NNC</dt>
          <dd>The region does not need a copy.</dd>
        </dl>
      </dd>
      <dt>type</dt>
      <dd>The type of the region. One of:
        <dl class="Bl-tag Bl-compact">
          <dt>dead</dt>
          <dd>A region associated with a dead VM object.</dd>
          <dt>device</dt>
          <dd>A region backed by device memory.</dd>
          <dt>none</dt>
          <dd>A region not backed by anything.</dd>
          <dt>phys</dt>
          <dd>A region backed by physical memory.</dd>
          <dt>swap</dt>
          <dd>A region backed by swap.</dd>
          <dt>unknown</dt>
          <dd>A region of unknown type.</dd>
          <dt>vnode</dt>
          <dd>A region backed by a file.</dd>
        </dl>
      </dd>
      <dt>fullpath</dt>
      <dd>The path to the file backing the memory region, or &#x2018;-&#x2019;
          if there is no such file.</dd>
      <dt>cred</dt>
      <dd>One of:
        <dl class="Bl-tag Bl-compact">
          <dt>CH</dt>
          <dd>The region is being charged to the user specified in the
              &#x2018;charged-uid&#x2019; field.</dd>
          <dt>NCH</dt>
          <dd>The region is not being charged to any user.</dd>
        </dl>
      </dd>
      <dt>charged-uid</dt>
      <dd>The UID of the user being charged, or -1 if no user is being
        charged.</dd>
    </dl>
  </dd>
  <dt><span class="Pa">mem</span></dt>
  <dd>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.</dd>
  <dt><span class="Pa">note</span></dt>
  <dd>Used for sending signals to the process. Not implemented.</dd>
  <dt><span class="Pa">notepg</span></dt>
  <dd>Used for sending signal to the process group. Not implemented.</dd>
  <dt><span class="Pa">osrel</span></dt>
  <dd>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.</dd>
  <dt><span class="Pa">regs</span></dt>
  <dd>Allows read and write access to the process' register set. This file
      contains a binary data structure <code class="Dv">struct regs</code>
      defined in
      <code class="In">&lt;<a class="In">machine/reg.h</a>&gt;</code>.
      <span class="Pa">regs</span> can only be written when the process is
      stopped.</dd>
  <dt><span class="Pa">rlimit</span></dt>
  <dd>This is a read-only file containing the process current and maximum
      limits. Each line is of the format <var class="Ar">rlimit current
      max</var>, with -1 indicating infinity.</dd>
  <dt><span class="Pa">status</span></dt>
  <dd>The process status. This file is read-only and returns a single line
      containing multiple space-separated fields as follows:
    <p class="Pp"></p>
    <ul class="Bl-bullet Bl-compact">
      <li>command name</li>
      <li>process id</li>
      <li>parent process id</li>
      <li>process group id</li>
      <li>session id</li>
      <li>device name of the controlling terminal, or a minus sign
          (&#x201C;-&#x201D;) if there is no controlling terminal.</li>
      <li>a list of process flags: <code class="Dv">ctty</code> if there is a
          controlling terminal, <code class="Dv">sldr</code> if the process is a
          session leader, <code class="Dv">noflags</code> if neither of the
          other two flags are set.</li>
      <li>the process start time in seconds and microseconds, comma
        separated.</li>
      <li>the user time in seconds and microseconds, comma separated.</li>
      <li>the system time in seconds and microseconds, comma separated.</li>
      <li>the wait channel message</li>
      <li>the process effective UID</li>
      <li>the process real UID</li>
      <li>group list, starting with the effective GID, comma-separated</li>
      <li>the hostname of the jail in which the process runs, or
          &#x2018;<code class="Li">-</code>&#x2019; to indicate that the process
          is not running within a jail.</li>
    </ul>
  </dd>
</dl>
<p class="Pp">Each node is owned by the process's user, and belongs to that
    user's primary group.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag Bl-compact">
  <dt><span class="Pa">/proc</span></dt>
  <dd>normal mount point for the <code class="Nm">procfs</code>.</dd>
  <dt><span class="Pa">/proc/pid</span></dt>
  <dd>directory containing process information for process
      <span class="Pa">pid</span>.</dd>
  <dt><span class="Pa">/proc/curproc</span></dt>
  <dd>directory containing process information for the current process</dd>
  <dt><span class="Pa">/proc/self</span></dt>
  <dd>directory containing process information for the current process</dd>
  <dt><span class="Pa">/proc/curproc/cmdline</span></dt>
  <dd>the process executable name</dd>
  <dt><span class="Pa">/proc/curproc/etype</span></dt>
  <dd>executable type</dd>
  <dt><span class="Pa">/proc/curproc/exe</span></dt>
  <dd>executable image</dd>
  <dt><span class="Pa">/proc/curproc/file</span></dt>
  <dd>executable image</dd>
  <dt><span class="Pa">/proc/curproc/fpregs</span></dt>
  <dd>the process floating point register set</dd>
  <dt><span class="Pa">/proc/curproc/map</span></dt>
  <dd>virtual memory map of the process</dd>
  <dt><span class="Pa">/proc/curproc/mem</span></dt>
  <dd>the complete virtual address space of the process</dd>
  <dt><span class="Pa">/proc/curproc/note</span></dt>
  <dd>used for signaling the process</dd>
  <dt><span class="Pa">/proc/curproc/notepg</span></dt>
  <dd>used for signaling the process group</dd>
  <dt><span class="Pa">/proc/curproc/osrel</span></dt>
  <dd>the process osrel value</dd>
  <dt><span class="Pa">/proc/curproc/regs</span></dt>
  <dd>the process register set</dd>
  <dt><span class="Pa">/proc/curproc/rlimit</span></dt>
  <dd>the process current and maximum rlimit</dd>
  <dt><span class="Pa">/proc/curproc/status</span></dt>
  <dd>the process' current status</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
<p class="Pp">To mount a <code class="Nm">procfs</code> file system on
    <span class="Pa">/proc</span>:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent"><code class="Li">mount -t procfs proc
  /proc</code></div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">procstat(1)</a>, <a class="Xr">mount(2)</a>,
    <a class="Xr">sigaction(2)</a>, <a class="Xr">unmount(2)</a>,
    <a class="Xr">kvm(3)</a>, <a class="Xr">libprocstat(3)</a>,
    <a class="Xr">pseudofs(9)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">This manual page written by <span class="An">Garrett
    Wollman</span>, based on the description provided by
    <span class="An">Jan-Simon Pendry</span>, and revamped later by
    <span class="An">Mike Pritchard</span>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">June 23, 2024</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>