Commit Graph

841 Commits

Author SHA1 Message Date
Michael Kerrisk 735334d454 Various pages: tfix (Oxford comma)
Discovered using:

    git grep -lE '^[^.].*, [^ ]*[^,] (or|and)\>'

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-09 11:02:33 +01:00
Michael Kerrisk 2c916a1d3c Various pages: Remove redundant "\\ " to escape spaces
Reported-by: Alejandro Colomar (man-pages) <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-01-08 13:42:27 +01:00
Michael Kerrisk 9f43659f85 getent.1, access.2, cacheflush.2, chroot.2, clock_getres.2, fcntl.2, getrusage.2, io_cancel.2, io_destroy.2, io_getevents.2, io_setup.2, io_submit.2, link.2, llseek.2, mmap.2, mount.2, readv.2, restart_syscall.2, semctl.2, set_mempolicy.2, set_tid_address.2, shmctl.2, sigaction.2, sigaltstack.2, spu_create.2, statfs.2, subpage_prot.2, syscalls.2, timer_getoverrun.2, uselib.2, INFINITY.3, __ppc_set_ppr_med.3, bstring.3, btree.3, ctime.3, fgetc.3, fopen.3, getcontext.3, gethostbyname.3, getnetent.3, getprotoent.3, getservent.3, inet.3, j0.3, list.3, makecontext.3, nextafter.3, posix_memalign.3, profil.3, pthread_tryjoin_np.3, puts.3, rcmd.3, resolver.3, rtime.3, sigsetops.3, strnlen.3, tailq.3, elf.5, filesystems.5, nscd.conf.5, proc.5, utmp.5, attributes.7, ipv6.7, packet.7, pthreads.7, signal-safety.7, signal.7, spufs.7, system_data_types.7, tcp.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-12-21 16:19:35 +01:00
Alejandro Colomar d556548bf4 getent.1, fanotify_mark.2, fcntl.2, futex.2, membarrier.2, mmap.2, mount.2, msgctl.2, readv.2, semctl.2, set_mempolicy.2, shmctl.2, syscalls.2, abs.3, bstring.3, btree.3, ctime.3, drand48.3, fgetc.3, fopen.3, gethostbyname.3, getnetent.3, getprotoent.3, getservent.3, INFINITY.3, __ppc_set_ppr_med.3, inet.3, j0.3, makecontext.3, printf.3, puts.3, resolver.3, sigsetops.3, elf.5, nscd.conf.5, proc.5, inotify.7, ipv6.7, spufs.7, system_data_types.7: Use Oxford comma
Found using:
pcregrep -rnM "^\.[B|I]R .*,\n\.[B|I].*[^,]\nand" man? |grep ^man |sort

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-15 21:30:30 +01:00
Michael Kerrisk 13648a9cfa proc.5: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-11-06 12:30:20 +01:00
Jann Horn 20e43cd694 proc.5: Document inaccurate RSS due to SPLIT_RSS_COUNTING
[mtk: Manually applied patch, because of conflicts with other
merged changes; also added an edit suggested by Jann; see the
thread at
https://lore.kernel.org/linux-man/20201012114940.1317510-1-jannh@google.com/]

Since 34e55232e59f7b19050267a05ff1226e5cd122a5 (introduced back in
v2.6.34), Linux uses per-thread RSS counters to reduce cache
contention on the per-mm counters. With a 4K page size, that means
that you can end up with the counters off by up to 252KiB per
thread.

Example:

$ cat rsstest.c
#include <stdlib.h>
#include <err.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/eventfd.h>
#include <sys/prctl.h>
void dump(int pid) {
  char cmd[1000];
  sprintf(cmd,
    "grep '^VmRSS' /proc/%d/status;"
    "grep '^Rss:' /proc/%d/smaps_rollup;"
    "echo",
    pid, pid
  );
  system(cmd);
}
int main(void) {
  eventfd_t dummy;
  int child_wait = eventfd(0, EFD_SEMAPHORE|EFD_CLOEXEC);
  int child_resume = eventfd(0, EFD_SEMAPHORE|EFD_CLOEXEC);
  if (child_wait == -1 || child_resume == -1) err(1, "eventfd");
  pid_t child = fork();
  if (child == -1) err(1, "fork");
  if (child == 0) {
    if (prctl(PR_SET_PDEATHSIG, SIGKILL)) err(1, "PDEATHSIG");
    if (getppid() == 1) exit(0);
    char *mapping = mmap(NULL, 80 * 0x1000, PROT_READ|PROT_WRITE,
                         MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);
    eventfd_write(child_wait, 1);
    eventfd_read(child_resume, &dummy);
    for (int i=0; i<40; i++) mapping[0x1000 * i] = 1;
    eventfd_write(child_wait, 1);
    eventfd_read(child_resume, &dummy);
    for (int i=40; i<80; i++) mapping[0x1000 * i] = 1;
    eventfd_write(child_wait, 1);
    eventfd_read(child_resume, &dummy);
    exit(0);
  }

  eventfd_read(child_wait, &dummy);
  dump(child);
  eventfd_write(child_resume, 1);

  eventfd_read(child_wait, &dummy);
  dump(child);
  eventfd_write(child_resume, 1);

  eventfd_read(child_wait, &dummy);
  dump(child);
  eventfd_write(child_resume, 1);

  exit(0);
}
$ gcc -o rsstest rsstest.c && ./rsstest
VmRSS:	      68 kB
Rss:                 616 kB

VmRSS:	      68 kB
Rss:                 776 kB

VmRSS:	     812 kB
Rss:                 936 kB

$

Let's document that those counters aren't entirely accurate.

Reported-by: Mark Mossberg <mark.mossberg@gmail.com>
Signed-off-by: Jann Horn <jannh@google.com>

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:52:08 +01:00
Michael Kerrisk 14948ad6ec proc.5: Minor fixes
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk bd13ace0c5 proc.5: ffix: use a hanging list as is done elsewhere in the page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk 167f94b707 proc.5: Update capability requirements for accessing /proc/[pid]/map_files
The requirements changed with kernel commit 12886f8ab10ce6.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-27 14:51:44 +01:00
Michael Kerrisk 11fd5e7c2a membarrier.2, openat2.2, insque.3, proc.5, tzfile.5, hier.7: Minor grammar fix
Don't hyphenate after adjective ending in "ly". See, for example:
https://www.dragoman.ist/compound-modifiers-with-words-ending-in-ly/
https://www.merriam-webster.com/words-at-play/6-common-hypercorrections-and-how-to-avoid-them/between-you-and-i

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 13:12:57 +01:00
Jing Peng 9ae9894c8e proc.5: wfix
In the section for /proc/[pid]/smaps, the description of field
ProtectionKey occurs twice: both before and after the description of
VmFlags.

Changes made by this patch:
1) Only the first occurrence is kept because its order matches the
output of /proc/[pid]/smaps.
2) The kernel version that CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS was
introduced is only mentioned in the second occurrence. Now it's moved
to the first one.

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-25 09:47:47 +01:00
Samanta Navarro 9d4976ce7d mmap.2, proc.5, bpf-helpers.7, cpuset.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-10-07 19:24:59 +02:00
Michael Kerrisk e3fb1b6bfc proc.5: ffix + srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 16:34:50 +02:00
Michael Kerrisk 161b8eda4d clone.2, io_submit.2, select.2, shmget.2, getcontext.3, malloc_info.3, mtrace.3, posix_spawn.3, strfromd.3, proc.5: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-29 14:24:12 +02:00
Michael Kerrisk 861d36ba31 pldd.1, bpf.2, clone.2, dup.2, ioctl_fat.2, nfsservctl.2, open_by_handle_at.2, perf_event_open.2, pivot_root.2, request_key.2, sched_setaffinity.2, seccomp.2, select.2, statx.2, dl_iterate_phdr.3, dlinfo.3, dlopen.3, insque.3, newlocale.3, printf.3, pthread_setname_np.3, rpc.3, stdarg.3, strfmon.3, veth.4, proc.5, slabinfo.5, cgroup_namespaces.7, cgroups.7, cpuset.7, fanotify.7, inotify.7, mount_namespaces.7, sock_diag.7, user_namespaces.7, ld.so.8: Use \(aq instead of ' inside monospace fonts
Use \(aq to get an unslanted single quote inside monospace code
blocks. Using a simple ' results in a slanted quote inside PDFs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-24 09:32:31 +02:00
Michael Kerrisk c3e8ceb883 proc.5: Note "open file description" as (better) synonym for "file handle"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-09-09 12:09:56 +02:00
Michael Kerrisk ed6c69cab9 intro.1, clock_getres.2, execve.2, fcntl.2, iopl.2, lseek.2, mknod.2, mmap.2, mount.2, mq_getsetattr.2, pidfd_open.2, prctl.2, setns.2, sgetmask.2, sigaction.2, stat.2, statx.2, sync.2, syscalls.2, syslog.2, timerfd_create.2, umask.2, a64l.3, aio_init.3, atoi.3, dladdr.3, fread.3, getpt.3, isfdtype.3, malloc_stats.3, malloc_trim.3, mkfifo.3, mq_close.3, mq_open.3, mq_receive.3, mq_send.3, mq_unlink.3, posix_memalign.3, posix_openpt.3, pthread_atfork.3, pthread_rwlockattr_setkind_np.3, regex.3, scanf.3, sem_close.3, sem_destroy.3, sem_init.3, sem_open.3, sem_post.3, sem_unlink.3, sigset.3, sigvec.3, strftime.3, termios.3, console_codes.4, dsp56k.4, fd.4, lp.4, mouse.4, pts.4, sk98lin.4, dir_colors.5, proc.5, resolv.conf.5, termcap.5, utmp.5, aio.7, armscii-8.7, arp.7, capabilities.7, cgroups.7, charsets.7, cp1251.7, cp1252.7, environ.7, glob.7, inode.7, iso_8859-1.7, iso_8859-10.7, iso_8859-11.7, iso_8859-13.7, iso_8859-14.7, iso_8859-15.7, iso_8859-16.7, iso_8859-2.7, iso_8859-3.7, iso_8859-4.7, iso_8859-5.7, iso_8859-6.7, iso_8859-7.7, iso_8859-8.7, iso_8859-9.7, keyrings.7, koi8-r.7, koi8-u.7, mailaddr.7, man-pages.7, netdevice.7, operator.7, persistent-keyring.7, process-keyring.7, pthreads.7, pty.7, raw.7, regex.7, session-keyring.7, shm_overview.7, signal.7, socket.7, suffixes.7, thread-keyring.7, unicode.7, units.7, uri.7, user-keyring.7, user-session-keyring.7, iconvconfig.8, ld.so.8, zic.8: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-13 10:01:14 +02:00
Michael Kerrisk af2d18b2c2 intro.1, clock_getres.2, clone.2, futex.2, ioctl_fat.2, mkdir.2, mknod.2, mmap.2, open.2, statx.2, umask.2, userfaultfd.2, glob.3, mkfifo.3, termios.3, wordexp.3, console_codes.4, sk98lin.4, vcs.4, dir_colors.5, hosts.equiv.5, proc.5, termcap.5, utmp.5, ascii.7, bpf-helpers.7, charsets.7, environ.7, glob.7, mailaddr.7, netlink.7, operator.7, suffixes.7, tcp.7, unicode.7, uri.7, zic.8: Use "\(ti" instead of "~"
A naked tilde ("~") renders poorly in PDF. Instead use "\(ti",
which renders better in a PDF, and produces the same glyph
when rendering on a terminal.

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-08-06 22:25:11 +02:00
Michael Kerrisk 0629df8b96 open.2, proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-31 22:32:59 +02:00
Jakub Wilk 9eff2f495f proc.5: Use "pwd -P" for printing cwd
"/bin/pwd" happens to work with the GNU coreutils implementation,
which has -P as the default, contrary to POSIX requirements.

Use "pwd -P" instead, which is shorter, easier to type, and should
work everywhere.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-20 11:35:07 +02:00
Jakub Wilk 9363af082e proc.5: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-20 11:27:26 +02:00
Michael Kerrisk 747f5636fd proc.5: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:44:40 +02:00
Michael Kerrisk a00214da73 proc.5: wfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-07-06 12:43:49 +02:00
Bjarni Ingi Gislason 81533e83e2 proc.5: srcfix: trim trailing space
Output is from: test-groff -b -mandoc -T utf8 -rF0 -t -w w -z

  [ "test-groff" is a developmental version of "groff" ]

Input file is ./proc.5

troff: <proc.5>:4410: warning: trailing space
troff: <proc.5>:5206: warning: trailing space
troff: <proc.5>:5488: warning: trailing space

###

  There is no change in the output from "nroff" and "groff".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-21 09:02:41 +02:00
Arkadiusz Drabczyk b260aaeca9 proc.5: Inform that comm in /proc/pid/{stat,status} might also be truncated
pgrep for example searches for a process name in /proc/pid/status
and therefore cannot find processes whose names are longer than 15
characters unless -f is specified.

Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-19 13:55:51 +02:00
Michael Kerrisk 0dbe186a35 proc.5: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-11 07:24:49 +02:00
Michael Kerrisk c919e22f82 proc.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 12:03:06 +02:00
Michael Kerrisk 73942082f2 proc.5: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-10 11:45:21 +02:00
Michael Kerrisk fd85c2387b openat2.2, proc.5, bpf-helpers.7: srcfix: strip trailing whitespace
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 14:48:40 +02:00
Michael Kerrisk b65e24c34a proc.5: Add a detail to /proc/[pid]/comm
Note the connection to the "%e" specifier in
/proc/sys/kernel/core_pattern.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 12:39:17 +02:00
Michael Kerrisk b463b03fd5 proc.5: TASK_COMM_LEN limit includes the terminating '\0'
Clarify this detail in the discussion of /proc/[pid]/comm.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-09 12:39:17 +02:00
Jakub Wilk 4ad5b7a575 proc.5: ffix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-06-08 17:41:12 +02:00
Michael Kerrisk b2401bcbd3 proc.5: Remove "mp" under VmFlags in /proc/[pid]/smaps
Reported-by: Kirill A. Shutemov <kirill@shutemov.name>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:29:06 +02:00
Michael Kerrisk 9a76645224 proc.5: Add "sf" to VmFlags in /proc/[pid]/smaps
Added in kernel commit b6fb293f2497a9841d94f6b57bd2bb2cd222da43
Text from comment in include/uapi/asm-generic/mman.h.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk bc60704e1a proc.5: Add "um" and "uw" to VmFlags in /proc/[pid]/smaps
Added in kernel commit 16ba6f811dfe44bc14f7946a4b257b85476fc16e.
Text taken from comments in include/linux/mm.h.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk d85aebeaa1 proc.5: Add "mp" to VmFlags in /proc/[pid]/smaps
Added in kernel commit 4aae7e436fa51faf4bf5d11b175aea82cfe8224a.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 8485aade48 proc.5: Note kernel version for /proc/PID/smaps VmFlags "dd" flag
Kernel commit ec8e41aec13005fed0dbee002fb8c99b4e001d50

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk efd54c4adf proc.5: Note kernel version that removed /proc/PID/smaps VmFlags "nl" flag
Kernel commit 1da4b35b001481df99a6dcab12d5d39a876f7056

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 016dedb300 proc.5: Note kernel version for /proc/PID/smaps VmFlags "wf" flag
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Ian Rogers 74603f4ecd proc.5: Add "wf" to VmFlags in /proc/[pid]/smaps
This patch documents a flag added in the following kernel commit:

commit d2cd9ede6e193dd7d88b6d27399e96229a551b19
Author: Rik van Riel <riel@redhat.com>
Date:   Wed Sep 6 16:25:15 2017 -0700

    mm,fork: introduce MADV_WIPEONFORK

This was already documented in man2/madvise.2 in the commit:

commit c0c4f6c29c
Author: Rik van Riel <riel@redhat.com>
Date:   Tue Sep 19 20:32:00 2017 +0200

    madvise.2: Document MADV_WIPEONFORK and MADV_KEEPONFORK

Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 0368720957 proc.5: Alert the reader that UID/GID changes can reset the "dumpable" attribute
Reported-by: Eric Hopper <hopper@omnifarious.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-21 14:27:34 +02:00
Michael Kerrisk c7169ee565 proc.5: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-20 11:24:27 +02:00
Michael Kerrisk f68d810435 proc.5: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-20 11:06:07 +02:00
Michael Kerrisk 31572c7125 proc.5: Minor tweaks to /proc/[pid]/mountstats example line
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-20 09:34:09 +02:00
Michael Kerrisk a6a5e521ab proc.5: Better explanation of some /proc/ide fields
Taken from Documentation/filesystems/proc.txt.

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-20 09:32:20 +02:00
Michael Kerrisk ea89336966 proc.5: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-20 00:07:19 +02:00
Michael Kerrisk 67df396fe6 proc.5: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-20 00:02:52 +02:00
Michael Kerrisk 83a20af064 proc.5: tfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-19 22:23:32 +02:00
Michael Kerrisk 42b070e639 proc.5: wfix
Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-19 22:13:21 +02:00
Michael Kerrisk 03306e1829 proc.5: Document /proc/sys/fs/protected_regular
Text heavily based on Documentation/admin-guide/sysctl/fs.rst.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 12:27:48 +02:00