Commit Graph

19807 Commits

Author SHA1 Message Date
Michael Kerrisk 44645ac4db getgroups.2: Note that a process can drop all groups with: setgroups(0, NULL)
Checking the FreeBSD source code, there's explicit support for
this to accommodate non-BSD systems (such as Linux).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-19 13:09:46 +01:00
Michael Kerrisk 1fa9fdb1e9 signal.7: Unify signal lists into a signal table that embeds standards info
Having the signals listed in three different tables reduces
readability, and would require more table splits if future
standards specify other signals.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 10:17:39 +01:00
Michael Kerrisk 6043ed9d54 signal.7: Insert standards info into tables
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 10:17:39 +01:00
Michael Kerrisk 9a10a14487 signal.7: Place signal numbers in a separate table
The current tables of signal information are unwieldy,
as they try to cram in too much information.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 10:17:39 +01:00
Michael Kerrisk bdbc9b4475 signal.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 08:59:02 +01:00
Benjamin Peterson 915c4ba36f futex.2: Make the example use C11 atomics rather than GCC builtins
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 08:21:51 +01:00
Michael Kerrisk 1605ddac8f getaddrinfo.3: Fix off-by-one error in example client program
Reported-by: Eric Sanchis <eric.sanchis@iut-rodez.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 08:11:07 +01:00
Michael Kerrisk da3ed81b42 pthread_rwlockattr_setkind_np.3: tfix
Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 07:41:18 +01:00
Carlos O'Donell 0d255e74c0 pthread_rwlockattr_setkind_np.3: Remove bug notes
The notes in pthread_rwlockattr_setkind_np.3 imply there is a bug
in glibc's implementation of PTHREAD_RWLOCK_PREFER_WRITER_NP (a
non-portable constant anyway), but this is not true. The
implementation of PTHREAD_RWLOCK_PREFER_WRITER_NP is made almost
impossible by the POSIX standard requirement that reader locks be
allowed to be recursive, and that requirement makes writer
preference deadlock without an impossibly complex requirement that
we track all reader locks. Therefore the only sensible solution
was to add PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP and
disallow recursive reader locks if you want writer preference.

This patch removes the bug description and documents the current
state and recommendations for glibc. I have also updated bug 7057
with this information, answering Steven Munroe's almost 10 year
old question :-) I hope Steven is enjoying his much earned
retirement.

Should we move the glibc discussion to some footnote? Some libc
may be able to implement the requirement to avoid deadlocks in the
future, but I doubt it (fundamental CS stuff).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 07:35:53 +01:00
Mike Rapoport a2463bae6f ioctl_userfaultfd.2, madvise.2, memfd_create.2, migrate_pages.2, mmap.2, shmget.2, subpage_prot.2, userfaultfd.2, malloc.3, proc.5, sysfs.5, tmpfs.5: Update paths for in-kernel memory management documentation files
Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 07:29:53 +01:00
Michael Kerrisk d893df00d9 capabilities.7: Update URL for libcap tarballs
The previous location does not seem to be getting updated.
(For example, at the time of this commit, libcap-2.26
had been out for two months, but was not present at
http://www.kernel.org/pub/linux/libs/security/linux-privs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-17 07:26:22 +01:00
Michael Kerrisk cf0866501d prctl.2: Note libcap(3) APIs for operating on ambient capability set
(However, the libcap APIs do not yet seem to have
manual pages...)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-16 21:45:10 +01:00
Michael Kerrisk d9a0d1d7b7 prctl.2: Mention libcap APIs for operating on capability bounding set
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-16 21:32:45 +01:00
Michael Kerrisk 6a1634dc09 syscalls.2: Update syscall list for Linux 4.18
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-11 08:07:35 +01:00
Michael Kerrisk 35f2e598f0 system.3: Use '(char *) NULL' rather than '(char *) 0'
Reported-by: Jonny Grant <jg@jguk.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-10 07:15:40 +01:00
Anthony Iliopoulos 99de80c58b ioctl_userfaultfd.2, userfaultfd.2: wfix
Use "UFFDIO_ZEROPAGE" consistently rather than "UFFDIO_ZERO".

Signed-off-by: Anthony Iliopoulos <ailiopoulos@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-10 07:12:40 +01:00
Michael Kerrisk 4f5bbd6115 system.3: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 23:17:15 +01:00
Michael Kerrisk f80fdeaf61 system.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 23:14:27 +01:00
Jakub Wilk b784b9d50f user_namespaces.7: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 16:02:07 +01:00
Michael Kerrisk 52fc743c1b pivot_root.2: Minor fixes to Elvira Khabirova's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 08:54:20 +01:00
Elvira Khabirova 82320f4201 pivot_root.2: Explain the initramfs case and point to switch_root(8).
Based on text from Documentation/filesystems/ramfs-rootfs-initramfs.txt.

Signed-off-by: Elvira Khabirova <lineprinter@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 08:52:40 +01:00
Michael Becker dfe50d30d8 resolver.3: Add documentation of res_nclose()
I found the neccessary information in the glibc sources.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 08:47:33 +01:00
Keith Thompson 3244025362 strfry.3: Remove incorrect reference to rand(3)
The strfry(3) function does not use rand(). The original version
from 1995 did, but it was changed to use a different PRNG in glibc
commit 4770745624b7f7f25623f1f10d46a4c4d6aec25c, 1996-12-04.

This C program demonstrates the behavior. By not calling srand(),
it gets the same values for successive calls to rand(), but
strfry() returns a different value each time the program is run.
If strfry() called srand(), it would alter the sequence of numbers
return by rand().

int main(void) {
    printf("%d\n", rand());
    char alphabet[] = "abcdefghijklmnopqrstuvwxyz";
    puts(strfry(alphabet));
    printf("%d\n", rand());
}

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 04:55:55 +01:00
Michael Kerrisk a13b92e5da signal.7: tfix
Reported-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-09 04:48:59 +01:00
Michael Kerrisk 4a501601a6 signal.7: Reorder the architectures in the signal number lists
x86 and ARM are the most common architectures, but currently
are in the second subfield in the signal number lists.
Instead, swap that info with subfield 1, so the most
common architectures are first in the list.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 22:35:50 +01:00
Helge Deller a42f9c51cb signal.7: Add signal numbers for parisc
This patch adds the signal numbers for parisc to the signal(7) man page.

Those parisc-specific values for the various signals are valid since the
Linux kernel upstream commit ("parisc: Reduce SIGRTMIN from 37 to 32 to
behave like other Linux architectures") during development of kernel 3.18:
http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1f25df2eff5b25f52c139d3ff31bc883eee9a0ab

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 22:35:45 +01:00
Helge Deller 8c3e685486 syscalls.2: parisc Linux does not any longer emulate HP-UX
Initially it was planned that the parisc linux port would natively
support 32-bit HP-UX binaries, but this compatibility was never
reached and finally dropped with Linux kernel 3.14.

With that background, drop parisc from the list of of platforms
which supports it's proprietary operating-system.

Additional notes from mtk:

The most relevant commit from the Linux 3.14 change log was:

[[
commit f5a408d53edef3af07ac7697b8bc54a755628450
Author: Guy Martin <gmsoft@tuxicoman.be>
Date:   Thu Jan 16 17:17:53 2014 +0100

    parisc: Make EWOULDBLOCK be equal to EAGAIN on parisc

    On Linux, only parisc uses a different value for EWOULDBLOCK which
    causes a lot of troubles for applications not checking for both values.
    Since the hpux compat is long dead, make EWOULDBLOCK behave the same as
    all other architectures.
]]

Additional notes from Helge:

The patch above is the initial and most important one with which
we stopped the HP-UX compatibility.

Then, with this commit in kernel 3.18 there is no way back:
"parisc: Reduce SIGRTMIN from 37 to 32 to behave like
other Linux architectures"
commit 1f25df2eff5b25f52c139d3ff31bc883eee9a0ab

And in kernel 4.0 we finally dropped the HP-UX compat layer
from Linux kernel source code with the commit series
"parisc: hpux - Drop support for HP-UX binaries":
commit 04c1614977168fb8f002e2d81f704eeabe0c5ebd

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 22:35:09 +01:00
Helge Deller 6f1033653f syscall.2: parisc needs care with syscall parameters
On parisc one needs to take care of the 32-bit calling conventions
with 64-bit syscall parameters on a 32-bit kernel. So on parisc we
suffer from the same issues like ARM, PowerPC and Xtensa.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 21:30:33 +01:00
Michael Kerrisk aa2c362324 cgroups.7: Minor fix: bump kernel version to 4.19 in a couple of points
The stated points still hold true as at Linux 4.1.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-07 21:30:33 +01:00
Josh Gao b085fc1fca io_submit.2: tfix
Signed-off-by: Josh Gao <jmgao@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-06 23:52:20 +01:00
Marko Myllynen 2e51e29c3c iconv.1: SEE ALSO: add uconv(1)
Refer to uconv(1) in iconv(1) manual page, it is helpful
transliterating e.g. Cyrillic to Latin:

echo <some-cyrillic-text> | uconv -f UTF-8 -t UTF-8 -x cyrillic-latin

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-06 21:53:21 +01:00
Michael Kerrisk eb8567a5c2 proc.5: ffix: break /proc/[pid]/task text into smaller paragraphs
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 21:57:20 +01:00
Michael Kerrisk 71b36dc767 proc.5: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 21:22:19 +01:00
Michael Kerrisk 7fe3b32bc8 proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 21:21:50 +01:00
Michael Kerrisk 37cd58d2d4 proc.5: Minor reworking of description of /proc/[tid] directories
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 21:14:25 +01:00
Michael Kerrisk 71190dedfe proc.5: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 21:02:18 +01:00
Michael Kerrisk 7159b279cc rename.2: tfix
Reported-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 20:37:20 +01:00
Michael Kerrisk 010a79cd86 rename.2: wfix: s/shmem/tmpfs/ in discussion of RENAME_NOREPLACE
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:41:49 +01:00
Michael Kerrisk 9738a72a0b rename.2: XFS support for RENAME_NOREPLACE was added in Linux 4.0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:40:15 +01:00
Michael Kerrisk 62f68f105d rename.2: Rework list of supported filesystems for RENAME_NOREPLACE
There was probably a little too much detail in
Lukas Werkmeister's patch. Simplify, by removing a few
file systems, and arrange the information as a bulleted
list for easier readability.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:40:15 +01:00
Lucas Werkmeister 94b9d26faa rename.2: Add kernel versions for RENAME_NOREPLACE support
The RENAME_NOREPLACE flag was added with the initial release of the
renameat2 syscall in Linux 3.15, but support for most filesystems was
only added in later versions, and some may still not support it.

Signed-off-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:16:36 +01:00
Jakub Wilk 587ff4d5af vdso.7: tfix
Escape hyphens; use \(aq for ASCII apostrophes.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 17:00:05 +01:00
Elliot Hughes 7c2c86efb7 getmntent.3: Clarify that endmntent() should be used rather than fclose()
This doesn't actually matter on any C library I know of --- they
all just do a NULL check and forward to fclose(3). (The actual
mistake I saw was someone not realizing that they had to call
*anything*.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 16:52:40 +01:00
Elliot Hughes c36a6bedf6 ferror.3: Warn about closing the result of fileno()
Since adding checking to Android's bionic for file descriptor
double-closes, we've found that the most common cause of these
bugs is incorrect use of fileno(3). There appears to be a common
misconception that it transfers ownership of the file descriptor
to the caller.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 16:50:52 +01:00
Michael Kerrisk b79b66d119 getrlimit.2: Resource limits are process-wide attributes shared by all threads
This was already noted in pthreads(7), but bears repeating here.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 15:23:19 +01:00
Michael Kerrisk 4641c596b3 proc.5: Document /proc/PID/status CoreDumping field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 12:40:46 +01:00
Michael Kerrisk 422425ff92 proc.5: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 12:35:30 +01:00
Michael Kerrisk fcfac78d29 proc.5: /proc/[pid]/status VmPMD field was removed in Linux 4.15
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 12:30:25 +01:00
Michael Kerrisk f7bbc79dbc proc.5: Document /proc/Meminfo LazyFree field
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 12:25:57 +01:00
Michael Kerrisk f9326a24ff proc.5: Fix kernel source pathname for soft-dirty documentation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-11-05 12:21:46 +01:00