From 37d5e699477a69de48e3df7e9909b1c768cfeec9 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 18 Aug 2017 01:11:26 +0200 Subject: [PATCH] proc.5: ffix Signed-off-by: Michael Kerrisk --- man5/proc.5 | 159 +++++++++++++++++++++++++++------------------------- 1 file changed, 82 insertions(+), 77 deletions(-) diff --git a/man5/proc.5 b/man5/proc.5 index c4ec66655..2783db8c9 100644 --- a/man5/proc.5 +++ b/man5/proc.5 @@ -449,9 +449,9 @@ To find out the current working directory of process 20, for instance, you can do this: .IP .in +4n -.nf +.EX .RB "$" " cd /proc/20/cwd; /bin/pwd" -.fi +.EE .in .IP Note that the @@ -483,11 +483,11 @@ when the currently executing program was started via The entries are separated by null bytes (\(aq\\0\(aq), and there may be a null byte at the end. Thus, to print out the environment of process 1, you would do: +.IP .in +4n -.nf - +.EX .RB "$" " strings /proc/1/environ" -.fi +.EE .in .IP If, after an @@ -618,11 +618,11 @@ For example, assuming that is the flag designating an input file and .I \-o is the flag designating an output file: +.IP .in +4n -.nf - +.EX .RB "$" " foobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ..." -.fi +.EE .in .IP and you have a working filter. @@ -654,11 +654,11 @@ and in .IR /proc/self/fd . Thus the example command above could be written as: +.PP .in +4n -.nf - +.EX .RB "$" " foobar \-i /dev/stdin \-o /dev/stdout ..." -.fi +.EE .in .IP Permission to dereference or read @@ -678,14 +678,14 @@ The content depends on the type of file referred to by the corresponding file descriptor. .IP For regular files and directories, we see something like: +.IP .in +4n -.nf - +.EX .RB "$" " cat /proc/12015/fdinfo/4" pos: 1000 flags: 01002002 mnt_id: 21 -.fi +.EE .in .IP The fields are as follows: @@ -726,12 +726,12 @@ we see (since Linux 3.8) the following fields: .IP .in +4n -.nf +.EX pos: 0 flags: 02 mnt_id: 10 eventfd-count: 40 -.fi +.EE .in .IP .I eventfd-count @@ -744,13 +744,13 @@ we see (since Linux 3.8) the following fields: .IP .in +4n -.nf +.EX pos: 0 flags: 02 mnt_id: 10 tfd: 9 events: 19 data: 74253d2500000009 tfd: 7 events: 19 data: 74253d2500000007 -.fi +.EE .in .IP Each of the lines beginning @@ -777,12 +777,12 @@ we see (since Linux 3.8) the following fields: .IP .in +4n -.nf +.EX pos: 0 flags: 02 mnt_id: 10 sigmask: 0000000000000006 -.fi +.EE .in .IP .I sigmask @@ -801,13 +801,13 @@ we see (since Linux 3.8) the following fields: .IP .in +4n -.nf +.EX pos: 0 flags: 00 mnt_id: 11 inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:2af87e00220ffd73 inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:27261900802dfd73 -.fi +.EE .in .IP Each of the lines beginning with "inotify" displays information about @@ -841,13 +841,13 @@ we see (since Linux 3.8) the following fields: .IP .in +4n -.nf +.EX pos: 0 flags: 02 mnt_id: 11 fanotify flags:0 event-flags:88002 fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:4f261900a82dfd73 -.fi +.EE .in .IP The fourth line displays information defined when the fanotify group @@ -898,9 +898,9 @@ See .IR /proc/[pid]/io " (since kernel 2.6.20)" .\" commit 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2 This file contains I/O statistics for the process, for example: +.IP .in +4n -.nf - +.EX .RB "#" " cat /proc/3828/io" rchar: 323934931 wchar: 323929600 @@ -909,7 +909,7 @@ syscw: 632675 read_bytes: 0 write_bytes: 323932160 cancelled_write_bytes: 0 -.fi +.EE .in .IP The fields are as follows: @@ -1003,14 +1003,14 @@ Entries are named by memory region start and end address pair (expressed as hexadecimal numbers), and are symbolic links to the mapped files themselves. Here is an example, with the output wrapped and reformatted to fit on an 80-column display: +.IP .in +4n -.nf - +.EX .RB "#" " ls -l /proc/self/map_files/" lr\-\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:31 3252e00000\-3252e20000 \-> /usr/lib64/ld-2.15.so \&... -.fi +.EE .in .IP Although these entries are present for memory regions that were @@ -1024,12 +1024,12 @@ means that such regions also appear on this directory. Here is an example where the target file is the deleted .I /dev/zero one: +.IP .in +4n -.nf - +.EX lrw\-\-\-\-\-\-\-. 1 root root 64 Apr 16 21:33 7fc075d2f000\-7fc075e6f000 \-> /dev/zero (deleted) -.fi +.EE .in .IP This directory appears only if the @@ -1089,14 +1089,14 @@ The .I perms field is a set of permissions: .IP -.nf -.in +5 +.in +4 +.EX r = read w = write x = execute s = shared p = private (copy on write) -.fi +.EE .in .IP The @@ -1283,11 +1283,13 @@ This file exports information (statistics, configuration information) about the mount points in the process's mount namespace (see .BR mount_namespaces (7)). Lines in this file have the form: -.nf - +.IP +.in +4n +.EX device /dev/sda7 mounted on /home with fstype ext3 [statistics] ( 1 ) ( 2 ) (3 ) (4) -.fi +.EE +.in .IP The fields in each line are: .RS 7 @@ -1541,22 +1543,22 @@ An example illustrates this point. In one terminal, we start a shell in new user and mount namespaces, and in that shell we create some new mount points: .IP -.nf .in +4n +.EX $ \fBPS1='sh1# ' unshare \-Urnm\fP sh1# \fBmount \-t tmpfs tmpfs /etc\fP # Mount empty tmpfs at /etc sh1# \fBmount \-\-bind /usr /dev\fP # Mount /usr at /dev sh1# \fBecho $$\fP 27123 +.EE .in -.fi .IP In a second terminal window, in the initial mount namespace, we look at the contents of the corresponding mounts in the initial and new namespaces: .IP -.nf .in +4n +.EX $ \fBPS1='sh2# ' sudo sh\fP sh2# \fBls /etc | wc \-l\fP # In initial NS 309 @@ -1569,8 +1571,8 @@ sh2# \fBls /proc/27123/root/dev | wc \-l\fP # /dev in other NS # mounted to /usr sh2# \fBls /usr | wc \-l\fP # /usr in initial NS 11 +.EE .in -.fi .IP .\" The following was still true as at kernel 2.6.13 In a multithreaded process, the contents of the @@ -1642,9 +1644,9 @@ This file shows memory consumption for each of the process's mappings. command displays similar information, in a form that may be easier for parsing.) For each mapping there is a series of lines such as the following: +.IP .in +4n -.nf - +.EX 00400000-0048a000 r-xp 00000000 fd:03 960637 /bin/bash Size: 552 kB Rss: 460 kB @@ -1666,9 +1668,9 @@ MMUPageSize: 4 kB Locked: 0 kB ProtectionKey: 0 VmFlags: rd ex mr mw me dw - -.fi +.EE .in +.PP The first of these lines shows the same information as is displayed for the mapping in .IR /proc/[pid]/maps . @@ -2113,9 +2115,9 @@ The thread's exit status in the form reported by .I /proc/[pid]/statm Provides information about memory usage, measured in pages. The columns are: +.IP .in +4n -.nf - +.EX size (1) total program size (same as VmSize in \fI/proc/[pid]/status\fP) resident (2) resident set size @@ -2128,7 +2130,7 @@ lib (5) library (unused since Linux 2.6; always 0) data (6) data + stack .\" (including libs; broken, includes library text) dt (7) dirty pages (unused since Linux 2.6; always 0) -.fi +.EE .in .TP .I /proc/[pid]/status @@ -2138,9 +2140,9 @@ and .I /proc/[pid]/statm in a format that's easier for humans to parse. Here's an example: +.IP .in +4n -.nf - +.EX .RB "$" " cat /proc/$$/status" Name: bash Umask: 0022 @@ -2195,7 +2197,7 @@ Mems_allowed: 1 Mems_allowed_list: 0 voluntary_ctxt_switches: 150 nonvoluntary_ctxt_switches: 545 -.fi +.EE .in .IP The fields are as follows: @@ -2532,7 +2534,7 @@ Each timer is listed with a line that starts with the string "ID:". For example: .IP .in +4n -.nf +.EX ID: 1 signal: 60/00007fff86e452a8 notify: signal/pid.2634 @@ -2541,7 +2543,7 @@ ID: 0 signal: 60/00007fff86e452a8 notify: signal/pid.2634 ClockID: 1 -.fi +.EE .in .IP The lines shown for each timer have the following meanings: @@ -2653,11 +2655,11 @@ The order matches the column number, when starting to count at zero. For example on a x86_64 system: .IP .in -12n -.nf +.EX Node 0, zone DMA 1 1 1 0 2 1 1 0 1 1 3 Node 0, zone DMA32 65 47 4 81 52 28 13 10 5 1 404 Node 0, zone Normal 216 55 189 101 84 38 37 27 5 3 587 -.fi +.EE .in .IP In this example, there is one node containing three zones and there @@ -2724,12 +2726,12 @@ and As long as no changes have been made to the following file, the contents of .I /proc/config.gz -are the same as those provided by : +are the same as those provided by: +.IP .in +4n -.nf - +.EX cat /lib/modules/$(uname \-r)/build/.config -.fi +.EE .in .IP .I /proc/config.gz @@ -2813,7 +2815,7 @@ There are directories for each IDE channel and attached device. Files include: .IP .in +4n -.nf +.EX cache buffer size in KB capacity number of sectors driver driver version @@ -2824,7 +2826,7 @@ model manufacturer's model number settings drive settings smart_thresholds in hexadecimal smart_values in hexadecimal -.fi +.EE .in .IP The @@ -3378,14 +3380,15 @@ Inter-| Receive | Transmit .I /proc/net/dev_mcast Defined in .IR /usr/src/linux/net/core/dev_mcast.c : -.nf -.in +5 +.IP +.in +4 +.EX indx interface_name dmi_u dmi_g dmi_address 2 eth0 1 0 01005e000001 3 eth1 1 0 01005e000001 4 eth2 1 0 01005e000001 +.EE .in -.fi .TP .I /proc/net/igmp Internet Group Management Protocol. @@ -3524,11 +3527,13 @@ This file contains information about netfilter user-space queueing, if used. Each line represents a queue. Queues that have not been subscribed to by user space are not shown. -.nf - +.IP +.in +4n +.EX 1 4207 0 2 65535 0 0 0 1 (1) (2) (3)(4) (5) (6) (7) (8) -.fi +.EE +.in .IP The fields in each line are: .RS 7 @@ -3638,13 +3643,13 @@ scsi currently supports only the \fIadd-single-device\fP command which allows root to add a hotplugged device to the list of known devices. .IP The command +.IP .in +4n -.nf - +.EX echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi - -.fi +.EE .in +.IP will cause host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. If there @@ -4343,19 +4348,19 @@ and that is: .IP .in +4n -.nf +.EX .RB "#" " echo \(aqdarkstar\(aq > /proc/sys/kernel/hostname" .RB "#" " echo \(aqmydomain\(aq > /proc/sys/kernel/domainname" -.fi +.EE .in .IP has the same effect as .IP .in +4n -.nf +.EX .RB "#" " hostname \(aqdarkstar\(aq" .RB "#" " domainname \(aqmydomain\(aq" -.fi +.EE .in .IP Note, however, that the classic darkstar.frop.org has the