Commit Graph

21060 Commits

Author SHA1 Message Date
Michael Kerrisk 17d860301a clone.2: wfix
Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 21:16:53 +02:00
Michael Kerrisk 673d16daad clone.2: Combine separate NOTES sections
Somewhere along the way, this page ended up with two NOTES
sections. Combine them.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Michael Kerrisk edc1b9fcd2 clone.2: Place CLONE_INTO_CGROUP text in correct alphabetical position
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Michael Kerrisk 6ba79da96e clone.2: ERRORS: add error cases for CLONE_INTO_CGROUP
These errors verified by experiment.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Michael Kerrisk ed7c137731 clone.2: Substantial reworking of Christian Brauner's CLONE_INTO_CGROUP text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Michael Kerrisk f7d5e0822a clone.2: Add kernel version numbers for clone_args fields
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Michael Kerrisk 5c216c0f7f clone.2: Some rewording of Christian Brauner's CLONE_INTO_CGROUP patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Michael Kerrisk b19679f754 clone.2: srcfix: semantic newlines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:11 +02:00
Christian Brauner aed3cc90e0 clone.2: Document the clone3() CLONE_INTO_CGROUP flag
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:09 +02:00
Michael Kerrisk 81b8997f5f pipe.2, sigaltstack.2, abort.3, signal.7: Place SH sections in standard order
Fix various pages that deviated from the norm described in
man-pages(7).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 15:45:01 +02:00
Michael Kerrisk 03cdc3e79b des_crypt.3: Minor wording fix in VERSIONS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 09:39:01 +02:00
Michael Kerrisk 33e0202939 malloc.3: Add VERSIONS section noting when reallocarray() was added to glibc
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 08:05:52 +02:00
Michael Kerrisk 1cff573d31 malloc.3: Add 'reallocarray' in NAME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 08:05:52 +02:00
Michael Kerrisk e3a78ee965 adjtimex.2, prctl.2, semget.2, signalfd.2, umount.2, syscall.2, dlopen.3, getgrent_r.3, killpg.3: Add section number in page cross-reference (adjtime(3))
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 08:04:55 +02:00
Michael Kerrisk 9bfa575a6b sched_setattr.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 08:04:55 +02:00
Michael Kerrisk 3bf4529ec7 adjtimex.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 07:40:56 +02:00
Michael Kerrisk 74132c7775 adjtimex.2: Add 'clock_adjtime' to NAME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 07:37:13 +02:00
Michael Kerrisk a36d5a3593 close.2, poll.2, pthread_spin_init.3: Remove section number in page self-references
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 07:34:38 +02:00
Michael Kerrisk 0345fbd451 utimensat.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 07:27:03 +02:00
Michael Kerrisk c8fb1c6d4a gettid.2, open.2, seccomp.2, pthread_mutex_consistent.3, signal.7, xattr.7: Put SEE ALSO entries in alphabetical order
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 07:23:34 +02:00
Kir Kolyshkin bba4bbbd9a Various pages: Add missing commas in SEE ALSO part II
This is a sequel to commit baf17bc4f2, addressing the
issues with missing commas in the middle of SEE ALSO lists that
emerged since.

The awk script from the original commit was not working and had to
be slightly modified (s/["]SEE ALSO["]/"?SEE ALSO/), otherwise it
works like a charm. Here's the fixed script and its output just
before this commit:

for f in man*/*; do
awk '
    /^.SH "?SEE ALSO/ {
	sa=1; print "== " FILENAME " =="; print; next
    }
    /^\.(PP|SH)/ {
	sa=0; no=0; next
    }
    /^\.BR/ {
	if (sa==1) {
	    print;
	    if (no == 1)
		print "Missing comma in " FILENAME " +" FNR-1; no=0
	}
    }
    /^\.BR .*)$/ {
	if (sa==1)
	    no=1;
	next
    }
    /\.\\"/ {next}
    /.*/ {
	if (sa==1) {
	    print; next
	}
    }
' $f; done | grep Missing
Missing comma in man1/memusage.1 +272
Missing comma in man2/adjtimex.2 +597
Missing comma in man2/adjtimex.2 +598
Missing comma in man2/mkdir.2 +252
Missing comma in man2/sigaction.2 +1045
Missing comma in man2/sigaction.2 +1047
Missing comma in man3/mbsnrtowcs.3 +198
Missing comma in man3/ntp_gettime.3 +142
Missing comma in man3/strcmp.3 +219
Missing comma in man3/strtol.3 +302
Missing comma in man3/wcstombs.3 +120
Missing comma in man7/user_namespaces.7 +1378
Missing comma in man7/xattr.7 +198

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-18 21:37:48 +02:00
Michael Kerrisk aa02339ca4 filesystems.5: SEE ALSO: add sysfs(5) and xfs(5)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-15 11:50:47 +02:00
Ondrej Slamecka 448d14e716 ip.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-15 11:49:54 +02:00
Michael Kerrisk 11b0b31a14 prctl.2: ffix
Reported-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 13:44:06 +02:00
Michael Kerrisk cd41e08cbf prctl.2: Soften Dave Martin's warning about the use of prctl()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 13:37:45 +02:00
Dave Martin f7abc99cf9 prctl.2: Clarify the unsupported hardware case of EINVAL
prctls that are architecture-specific won't work on other
architectures, and arch-specific prctls that manipulate optional
hardware features likewise won't work if that hardware feature is
not present.

The established pattern seems to be to treat such prctls as if they
are unimplemented, when attempted on the wrong hardware.

Cover these cases with some generic weasel words in the closet
existing EINVAL clause.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:49:36 +02:00
Michael Kerrisk 49a88f5dec prctl.2: ffix to "Work around bogus constant "maxsig" in PR_SET_PDEATHSIG" patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:44:23 +02:00
Michael Kerrisk 230dd8d060 prctl.2: wfix to "prctl.2: Document removal of Intel MPX prctls" patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:41:31 +02:00
Michael Kerrisk 0841915dee prctl.2: tfix to "prctl.2: Add health warning" patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:37:58 +02:00
Dave Martin e6935958b7 prctl.2: tfix: minor punctuation in SPECULATION_CTRL prctls
Fix a few very minor bits of punctuation in
PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:34:28 +02:00
Dave Martin bfc592db67 prctl.2: Work around bogus constant "maxsig" in PR_SET_PDEATHSIG
The description of PR_SET_PDEATHSIG refers to "maxsig", which
is apparently intended to stand for the maximum defined signal
number.

maxsig seems not to be a thing, even in the kernel.

Reword to use the standard constant NSIG.  (Discussion of SIGRTMIN
and SIGRTMAX seems out of scope here, and anyway is not relevant
to the kernel.)

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:34:13 +02:00
Dave Martin 2ab5fe267f prctl.2: Document removal of Intel MPX prctls
The Intel MPX API was removed from Linux 5.4.  See Linux
commit f240652b6032 ("x86/mpx: Remove MPX APIs")

Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:34:02 +02:00
Dave Martin 194ccff9cc prctl.2: Sort prctls into alphabetical order
The prctl list has historically been sorted by prctl name (ignoring
any SET_ or GET_ prefix) to make individual prctls easier to find.
Some noise seems to have crept in since.

Sort the list back into order.  Similarly, reorder the list of
prctls specified to return non-zero values on success.

Content movement only.  No semantic change.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:33:53 +02:00
Dave Martin 667eb3ac39 prctl.2: srcfix: add comments for navigation
The prctl.2 source is unnecessarily hard to navigate, not least
because prctl option flags are traditionally named PR_* and so look
just like prctl names.

For each actual prctl, add a comment of the form

	.\" prctl PR_FOO

to make it move obvious where each top-level prctl starts.

Of course, we could add some clever macros, but let's not confuse
dumb parsers.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:33:45 +02:00
Dave Martin ec5cb536b1 prctl.2: Add health warning
In reality, almost every prctl interferes with assumptions that the
compiler and C library / runtime rely on.  prctl() can therefore
make userspace explode in a variety ways that are likely to be hard
to debug.

This is not obvious to the uninitiated, so add a warning.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:32:50 +02:00
Dave Martin 5aaf1385fb prctl.2: Fix mis-description of thread ID values in procfs
Under PR_SET_NAME, the [tid] value seen in procfs as
/proc/self/task/[tid] is mistakenly described as the name of the
thread, whereas really the name is on /proc/self/task/[tid]/comm.

Fix it.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:32:40 +02:00
Dave Martin 1e0d99b899 prctl.2: Clarify that prctl can apply to threads
The current synopsis for prctl(2) misleadingly claims that prctl
operates on a process.  Rather, some (in fact, most) prctls operate
on a thread.

The wording probably dates back to the old days when Linux didn't
really have threads at all.

Reword as appropriate.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-13 12:32:32 +02:00
Michael Kerrisk 3f1dc8e16a stat.2: Minor reworking of text describing AT_NO_AUTOMOUNT
No content changes. Just put things in a slightly more logical
order and add a few paragraph breaks for readability.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 11:35:35 +02:00
Michael Kerrisk 7200e79646 symlink.7: Describe differences in the treatment of symlinks in the dirname
Describe differences in the treatment of symlinks in the dirname
part of pathname.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 09:47:18 +02:00
Michael Kerrisk 4146f81b7d open.2: Some '*at' APIs have functionality that isn't in conventional APIs
Note that another reason to use the *at() APIs is to access
'flags' functionality that is not available in the corresponding
conventional APIs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 09:43:01 +02:00
Michael Kerrisk 9660f3baaf symlink.7: wfix
The close proximity of an em-dash and a hyphen is a little
visually jarring.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 09:43:01 +02:00
Michael Kerrisk 4d989e3563 stat.2: wfix ("it" used with two different referents in same sentence)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 09:42:56 +02:00
Michael Kerrisk 96c44b8f50 open.2: Explain ways in which a 'directory file descriptor' can be obtained
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 08:45:06 +02:00
Michael Kerrisk aec13430b1 open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 08:03:52 +02:00
Michael Kerrisk 5c30e7cd9d open.2: Add a few more APIs to list in "Rationale for openat()..."
There have been a few more dirfd APIs added in recent times.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 07:43:41 +02:00
Michael Kerrisk 7022462f1d dirfd.3: SEE ALSO: add openat(2)
By way of a hint that the file descriptor returned by dirfd()
could usefully be fed to the *at() APIs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-12 07:07:30 +02:00
Kir Kolyshkin 483368b3b1 setenv.3: wfix
Both functions behave the same wrt return value, no need to describe
them separately.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-11 20:17:05 +02:00
Michael Kerrisk 3f298932bd pid_namespaces.7: Note that /proc/sys/kernel/ns_last_pid is virtualized per PID NS
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-11 14:07:36 +02:00
Michael Kerrisk 439526d153 pid_namespaces.7: Correct capability requirements for write to /proc/sys/kernel/ns_last_pid
CAP_SYS_ADMIN is needed in the user NS that owns the PID NS.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-11 14:06:09 +02:00
Michael Kerrisk c2f15a1349 close.2: Note behavior when close() happens in a parallel thread
If one thread is blocked in an I/O system call on a file descriptor
that is closed in another thread, then the blocking system call
does not return immediately, but rather when the I/O operation
completes. This surprises some people, but is longstanding
behavior.

See https://bugzilla.kernel.org/show_bug.cgi?id=53781

and

https://lore.kernel.org/lkml/3B1E3D86.C7A7874@canal-plus.fr/
To: linux-kernel@vger.kernel.org
Subject: PROBLEM: I/O system call never returns if file desc is closed in the  meantime
Date: Wed, 06 Jun 2001 16:26:14 +0200

Examples where people are surprised by this behavior:
https://www.linuxquestions.org/questions/linux-networking-3/recv-is-not-coming-out-of-blocking-after-closing-the-socket-459461/
https://stackoverflow.com/questions/3589723/can-a-socket-be-closed-from-another-thread-when-a-send-recv-on-the-same-socket

Reported-by: Thierry Lelegard <thierry.lelegard@canal-plus.fr>
Reported-by: Lukas Czerner <lczerner@redhat.com>
Reported-by: Peter Schiffer <pschiffe@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-09 13:24:39 +02:00