Commit Graph

21060 Commits

Author SHA1 Message Date
Michael Kerrisk d645b01b31 posix_fadvise.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk e1403777e7 y0.3: errno is now correctly set to ERANGE on underflow
The fix was in glibc 2.17. See
https://www.sourceware.org/bugzilla/show_bug.cgi?id=6808

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk 14b81bcfdf y0.3: srcfix: remove an ancient FIXME that no longer matters much
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk 696b65a571 y0.3: These functions now correctly diagnose a pole error
The fix was in glibc 2.19. See
https://sourceware.org/bugzilla/show_bug.cgi?id=6807

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 13:25:54 +02:00
Michael Kerrisk c2e0ff42a4 y0.3: srcfix: Note on "Range error: result underflow" and FE_UNDERFLOW
The fact that an FE_UNDERFLOW exception is not raised for
"Range error: result underflow" is intended behavior.
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6806.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 12:10:55 +02:00
Michael Kerrisk 84828d04a6 j0.3: srcfix: add notes that failing to raise FE_UNDERFLOW is intended behavior
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6805

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 11:26:00 +02:00
Michael Kerrisk 5b08d967e8 scalbln.3: These functions now correctly set errno for the ERANGE case
Modify DESCRIPTION appropriately and add BUGS section.
The fix was in glibc 2.20.

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6803

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 11:19:03 +02:00
Michael Kerrisk 121c4dfd41 hypot.3: srcfix: add some notes about the underflow case
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:56:28 +02:00
Michael Kerrisk 053d061aef sincos.3: The glibc implementation does now give EDOM for a domain error
The fix was in glibc 2.22
(commit d435569cd626bccb9c27361202a279d0fd7fce88).

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=15467

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:44:57 +02:00
Michael Kerrisk 442456d931 rename.2: SEE ALSO: add rename(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:29:11 +02:00
Michael Kerrisk e9832dc0da mount_namespaces.7: SEE ALSO: add mount(8), umount(8)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-26 10:29:11 +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
Tobias Stoeckmann 7577e4074b printf.3: Prevent signed integer overflow in example
The function make_message illustrates how to use vsnprintf to
determine the required amount of memory for a specific format and
its arguments.

If make_message is called with a format which will use exactly
INT_MAX characters (excluding '\0'), then the size++ calculation
will overflow the signed integer "size", which is an undefined
behaviour in C.

Since malloc and vsnprintf rightfully take a size_t argument, I
decided to use a size_t variable for size calculation. Therefore,
this patched code uses variables of the same data types as
expected by function arguments.

Proof of concept (tested on Linux/glibc amd64):

int main() { make_message("%647s%2147483000s", "", ""); }

If the code is compiled with address sanitizer (gcc
-fsanitize=address) you can see the following line, assuming that
a signed integer overflow simply leads to INT_MIN:

==3094==WARNING: AddressSanitizer failed to allocate 0xffffffff80000000 bytes

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:59:42 +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
Jakub Wilk 6a67ed89fc prctl.2: tfix
Remove duplicated word.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 7996b4e48c gettid.2: Document header file and feature test macro requirements for gettid()
The gettid() wrapper was added glibc 2.30, and is declared by
<unistd.h> if _GNU_SOURCE is defined.

Reported-by: Joseph C. Sible <josephcsible@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk a1d64896ae scanf.3: Clarify that 'x' specifier allows a 0x/0X prefix in input string
Reported-by: Jürgen Sauermann <mail@juergen-sauermann.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 09ba59d40c pow.3: Minor tweak to BUGS
Remove the text ("rare)" after a note from Vincent Lefèvre:

Subject: [Bug math/13932] dbl-64 pow unexpectedly slow for some inputs
Date: Sat, 23 May 2020 21:31:52 +0000
From: vincent-srcware at vinc17 dot net <sourceware-bugzilla@sourceware.org>
To: mtk.manpages@gmail.com

https://sourceware.org/bugzilla/show_bug.cgi?id=13932

--- Comment #26 from Vincent Lefèvre <vincent-srcware at vinc17 dot net> ---
(In reply to Michael Kerrisk from comment #25)
> Fix documented for man-pages-5.07.
[...]
> -On 64-bits,
> +Before glibc 2.28,
>  .\"
>  .\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> +on some architectures (e.g., x86-64)
>  .BR pow ()
>  may be more than 10,000 times slower for some (rare) inputs
>  than for other nearby inputs.
[...]

The problematic values are uncommon, but not so rare, in the sense
that they are close to simple values, i.e. are likely to occur in
practice. An example given above: pow(0.999999999999999889, 1.5)

1 and 1.5 are very simple values, which are more likely to occur
in practice than some fixed random value. Then it suffices to have
a small rounding error on 1...

For instance, this is very different from hard-to-round cases of
exp, which are also very slow IMHO, but unless one writes a
specific program for them, no-one should notice the slowness
because such a case would typically occur only once among billions
(I don't remember the accuracy before the slowest path in this
library).

Reported-by: Vincent Lefèvre <vincent-srcware@vinc17.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 247a2afa55 pow.3: srcfix: remove an ancient FIXME that is pretty irrelevant these days
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk e088313b3d pow.3: Add a subheading to mark off historical bugs that are now fixed
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 831db5db46 pow.3: Several bugs in glibc's pow() implementation were fixed in glibc 2.16
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=3866.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 427e4505b0 pow.3: BUGS: pow() performance problem for some (rare) inputs has been fixed
See https://sourceware.org/bugzilla/show_bug.cgi?id=13932
Fixed in glibc 2.28.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk e9e9f2424c hypot.3: srcfix: Clear an obsolete FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk e25000b9aa erf.3, erfc.3: srcfix: Clear an obsolete FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 2aadb86241 scalb.3: These functions now correctly set errno for the EDOM and ERANGE cases
Modify DESCRIPTION appropriately and add BUGS section.
The fix was in glibc 2.20.

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6803
and https://www.sourceware.org/bugzilla/show_bug.cgi?id=6804

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 839c0fe92a nextafter.3: Since glibc 2.23, these functions do set errno
Modify DESCRIPTION appropriately and add BUGS section.

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6799.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 4cc51f5e5a fdim.3: BUGS: these functions did not set errno on some architectures
The bug was fixed in glibc 2.24.
https://www.sourceware.org/bugzilla/show_bug.cgi?id=6796

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 62d6b18353 expm1.3: The bogus invalid floating-point exception bug has been fixed
Sometime around 2009 (approximately 2.11) according to
https://www.sourceware.org/bugzilla/show_bug.cgi?id=6814.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk 3887f72666 expm1.3: The expm1() bogus underflow floating-point exception has been fixed
Fixed in glibc 2.17.

See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6778

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 15:46:44 +02:00
Michael Kerrisk c82d80af7b mount_namespaces.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 21:56:19 +02:00
Florian Weimer 4e977eff3e ldconfig.8: Mention new default for --format in glibc 2.32
This reflects glibc commit cad64f778aced84efdaa04ae64f8737b86f063ab
("ldconfig: Default to the new format for ld.so.cache").

Signed-off-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 15:20:27 +02:00
Michael Kerrisk a83addc775 stdarg.3: SEE ALSO: add vprintf(3), vscanf(3), vsyslog(3)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 15:20:27 +02:00
Michael Kerrisk b0d3e315cc sysfs.2: SEE ALSO: add proc(5) and sysfs(5)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 15:20:27 +02:00
Michael Kerrisk 817d604ac5 nfsservctl.2: SEE ALSO: add nfsd(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 15:20:27 +02:00
Michael Kerrisk d6df7eae48 cexp2.3: Still not present in glibc 2.31
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 15:20:27 +02:00
Michael Kerrisk 07161ed5f2 sysfs.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 15:20:27 +02:00
Michael Kerrisk f2637a5625 standards.7: Remove mention of bogus "POSIX" names
The terms POSIX.1-{2003,2004,2013,2016} were inventions of
my imagination, as confirmed by consulting Geoff Clare of
The Open Group. Remove these names.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 11:09:17 +02:00
Michael Kerrisk f69f82d84c standards.7: Add some more standards
Add: SUSv4 2016 edition, POSIX.1-2017, and SUSv4 2018 edition

Reported-by: Geoff Clare <gwc@opengroup.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 11:09:17 +02:00
Alexander Monakov 88da10c16c dlsym.3: Extend discussion of NULL symbol values
Avoid implying that use of IFUNC is the only way to produce a
symbol with NULL value. Give more scenarios how a symbol may get
NULL value, but explain that in those scenarios dlsym() will fail
with Glibc's ld.so due to an implementation inconsistency.

Signed-off-by: Alexander Monakov <amonakov@ispras.ru>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 22:19:39 +02:00
Devin J. Pohly 1b0b13fe97 veth.4: Add a more direct example
iproute2 allows you to specify the netns for either side of a veth
interface at creation time.  Add an example of this to veth(4) so
it doesn't sound like you have to move the interfaces in a
separate step.

Verified with commands:
    # ip netns add alpha
    # ip netns add bravo
    # ip link add foo netns alpha type veth peer bar netns bravo
    # ip -n alpha link show
    # ip -n bravo link show

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 21:53:28 +02:00
Thomas Piekarski 3514b9beba hier.7: Updating from FHS 2.3 to 3.0
Adding description of new directories (/run, /usr/libexec,
/usr/share/color,/usr/share/ppd, /var/lib/color), stating
/usr/X11R6 as removed and updating URL to and version of FHS.

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

Reported-by: Gary Perkins <glperkins@lit.edu>
Signed-off-by: Thomas Piekarski <t.piekarski@deloquencia.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 21:48:04 +02:00
Michael Kerrisk 4fe3acd9e1 clone.2: Note a performance benefit of CLONE_INTO_CGROUP
As noted in email by Christian Brauner:

    I forgot to mention that spawning directly into a target
    cgroup is also more efficient than moving it after creation.
    The specific reason is mentioned in the commit message
    [ef2c41cf38a], the write lock of the semaphore need not be
    taken in contrast to when it is moved afterwards. That
    implementation details is not that interesting but it might
    be interesting to know that it provides performance benefits
    in general.

Reported-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 21:41:08 +02:00
Michael Kerrisk c0e4ab6356 cgroups.7: Note the existence of the clone3() CLONE_INTO_CGROUP flag
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 21:32:10 +02:00
Michael Kerrisk b3041511b8 clone.2: Restructure text on CLONE_INTO_CGROUP use cases
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-19 21:24:55 +02:00