Commit Graph

19500 Commits

Author SHA1 Message Date
Michael Kerrisk be914947a7 select.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-12 06:01:32 +02:00
Lucas Werkmeister f8bfb68e68 proc.5: tfix
mlock() is a system call and documented in section 2, not 3.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-10 13:38:51 +02:00
Matthew Kilgore 85bbb2a253 strcpy.3: Fix example code for strncpy, which could pass an incorrect length
The example code currently passes `buflen - 1` to `strncpy`,
however the length parameter to `strncpy` is `size_t`, which is
unsigned.  This means that when `buflen` is zero, the cast of `-1`
to unsigned will result in passing `UINT_MAX` as the length.
Obviously, that would be incorrect and could cause `strncpy` to
write well beyond the buffer passed.

The easy solution is to wrap the whole code in the `buflen > 0`
check, rather then just the part of the code that applies the null
terminator.

Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-10 13:36:46 +02:00
Michael Kerrisk 4c974cbac6 select.2: BUGS: the use of value-result arguments is a design bug
The use of value-result arguments is a design bug that is
not suffered by poll(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-01 09:08:28 +02:00
Nikola Forró c8097a40f5 host.conf.5: Clarify glibc versions in which spoof options were removed
The nospoof, spoofalert and spoof options as well as the
RESOLV_SPOOF_CHECK environment variable were all removed
from glibc in version 2.25 (with commit
7d68cdaa4f748e87ee921f587ee2d483db624b3d).

Signed-off-by: Nikola Forró <nforro@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-06-01 09:08:14 +02:00
Michael Kerrisk 8b5bbcfabc open.2: Minor wording fix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Lucas Werkmeister 71b12d0a57 open.2: Document ENXIO for sockets
Linux returns ENXIO when attempting to open() a UNIX domain socket.
Kernel-wise, I believe this happens in fs/inode.c [1], where a constant
`no_open` function returning -ENXIO is registered as the default open()
handler for inodes in inode_init_always(), and is not specialized in
nit_special_inode() as it is for other types.

Seen in the systemd v238 source code [2].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/inode.c?h=v4.16
[2]: https://github.com/systemd/systemd/blob/v238/src/core/execute.c#L412

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Mike Frysinger 946bdf7207 exit.3: Note wider sysexits.h availability
Since the BSD header has been imported to other C libraries (including
glibc), note that here so people know it isn't BSD-specific.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Mike Frysinger 26cea65499 scripts: mark them executable
It's easier to run `./scripts/foo.sh ...` than
`bash ./scripts/foo.sh ...`.  Mark them all +x to support that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Michael Kerrisk 6a4c997189 pkey_alloc.2: Switch to glibc prototype in SYNOPSIS
In the kernel, the type of the arguments to pkey_alloc() is
"unsigned long" and that's what the page documented until now.
Now that glibc support is added for pkey_alloc(), switch to the
glibc prototype, which uses "unsigned int".

Reported-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 21:34:32 +02:00
Jakub Wilk f9d9ad2163 setns.2: tfix
Remove duplicated word.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-31 07:58:06 +02:00
Michael Kerrisk dd08fccaae prctl.2: Add kernel version for PR_GET_SPECULATION_CTRL + PR_SET_SPECULATION_CTRL
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 13:52:41 +02:00
Michael Kerrisk a01c1cbcc3 prctl.2: Various fixups to Konrad Rzeszutek Wilk's text
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 13:50:07 +02:00
Michael Kerrisk 2feab5d3b1 prctl.2: Minor fixups
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 12:57:30 +02:00
Michael Kerrisk ac3756bc53 prctl.2: srcfix: rewrap source lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 12:57:30 +02:00
Michael Kerrisk e36dfb8186 prctl.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 12:57:30 +02:00
Konrad Rzeszutek Wilk e23acd79f9 prctl.2: Document PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 11:59:26 +02:00
Goldwyn Rodrigues ebf120124b write.2: Partial direct I/O writes
Direct writes can perform partial writes because large writes
can be broken into smaller chunks by the block layer. Part of
the I/O submitted can fail and the failure is returned to write
as an error in the return value. However, part of the write can
be successful which means that data at the offset is inconsistent.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 11:34:34 +02:00
Helge Deller 0201f48246 vdso.7: Fix parisc gateway page description
The parisc gateway page currently only exports 3 functions:
The lws_entry for CAS operations (at 0xb0), the set_thread_pointer
function for usage in glibc (at 0xe0) and the Linux syscall entry
(at 0x100).

All other symbols in the manpage are internal labels and
shouldn't be used directly by userspace or glibc, so drop them
from the man page documentation.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 11:04:33 +02:00
Michael Kerrisk 65c3312c6d putenv.3: wfix
Reported-by: James Weigle <jtweigle@uchicago.edu>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-28 10:58:45 +02:00
Michael Kerrisk e795580f53 select.2: Note that select() and pselect() are not affected by O_NONBLOCK
Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 11:01:16 +02:00
Michael Kerrisk 15e68be637 poll.2: Note that poll() and ppoll() are not affected by O_NONBLOCK
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 11:00:04 +02:00
Michael Kerrisk 3897a3f89f open.2: Clarify a special use case of O_NONBLOCK for devices
The wording is a little confusing, suggesting that this is
the primary use of O_NONBLOCK. Fix that.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:56:16 +02:00
Michael Kerrisk f2a110725b open.2: Clarify that O_NONBLOCK has no effect on poll/epoll/select
Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:25:53 +02:00
Michael Kerrisk b0972b3b05 open.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:14:49 +02:00
Michael Kerrisk 0cec24722b signal.7: Clarify that sigsuspend() and pause() suspend the calling *thread*
Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 10:04:37 +02:00
Michael Kerrisk 2ac1d1e3e7 sigsuspend.2: Clarify that sigsuspend() suspends the calling *thread*
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 09:58:07 +02:00
Michael Kerrisk 603a9fa5b6 sched_setparam.2: Clarify that scheduling parameters are per-thread (not per-process)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 09:54:31 +02:00
Michael Kerrisk 5fbfa7335f setns.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 09:48:40 +02:00
Michael Kerrisk 56d898aaa5 gettid.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-18 09:42:51 +02:00
Michael Kerrisk ac79419503 setns.2: Note capability requirements for changing network, IPC, or UTS namespace
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 23:04:02 +02:00
Michael Kerrisk b4e192495b setns.2: Note capability requirements for changing cgroup namespace
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 23:01:33 +02:00
Michael Kerrisk a5633e6b2d setns.2: Note capability requirements for changing PID namespace
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 23:01:15 +02:00
Michael Kerrisk 98929c3141 setns.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 22:55:42 +02:00
Michael Kerrisk c6b1b95b9e setns.2: Minor text reorganization
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 22:47:31 +02:00
Michael Kerrisk 0ecd580494 setns.2: Relocate PID-namespace-specific details
No content changes.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 22:39:22 +02:00
Michael Kerrisk 2e4a22de93 setns.2: ffix: add some paragraph breaks
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 22:35:33 +02:00
Michael Kerrisk 8e23f12b17 setns.2: Some logical text restructuring
Add subsection headings and use hanging list for details
of specific namespace types.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 22:34:07 +02:00
Michael Kerrisk 6f91075e49 setns.2: Minor wording fix
A process doesn't have a capability in a mount namespace, but
rather in the user namespace that owns the mount namespace.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-16 21:53:27 +02:00
Michael Kerrisk 4eae8eb731 clock_getres.2: CLOCK_MONOTONIC_RAW does not count while the system is suspended
Reported-by: Jens Thoms Toerring <jt@toerring.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 20:19:40 +02:00
Michael Kerrisk f224d2bc9e clock_getres.2: CLOCK_MONOTONIC does not count while the system is suspended
Reported-by: Jens Thoms Toerring <jt@toerring.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 20:15:32 +02:00
Michael Kerrisk 7d882a4a2a clock_getres.2: On Linux CLOCK_MONOTONIC counts time that the system has run since boot
Reported-by: Jens Thoms Toerring <jt@toerring.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 20:12:59 +02:00
Michael Kerrisk bccacb94dd gettimeofday.2, clock_getres.2: ERRORS: EINVAL can occur if new real time is less than monotonic clock
Attempts (settimeofday(), clcok_settime(CLOCK_REALTIME)) to set
the real time clock to a value less than the current value of the
CLOCK_MONOTONIC clock result in EINVAL.

In the kernel source file kernel/time/timekeeping.c::do_settimeofday64(),
there is this check:

        if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) {
                ret = -EINVAL;
                goto out;
        }

It appears that the check was added in Linux 4.3:

    commit e1d7ba8735551ed79c7a0463a042353574b96da3
    Author: Wang YanQing <udknight@gmail.com>
    Date:   Tue Jun 23 18:38:54 2015 +0800

        time: Always make sure wall_to_monotonic isn't positive

Reported-by: Jens Thoms Toerring <jt@toerring.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 16:21:03 +02:00
Michael Kerrisk 018c296c7e gettimeofday.2: ERRORS: add EINVAL for noncanonical 'tv' argument to settimeofday()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 16:21:00 +02:00
Michael Kerrisk 9a82d4d95e gettimeofday.2: Minor rewording of settimeofday() EINVAL error for timezone
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 16:20:56 +02:00
Michael Kerrisk 9f23d9477c clock_getres.2: ERRORS: add EINVAL error for noncanonical clock_settime() value
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-13 16:20:42 +02:00
Michael Kerrisk 390795d76a inotify.7: Note ENOTDIR error that can occur for IN_ONLYDIR
Note ENOTDIR error that occurs when requesting a watch on a
nondirectory with IN_ONLYDIR.

Reported-by: Paul Millar <paul.millar@desy.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-06 10:22:13 +02:00
Paul Millar 12507e51a4 inotify_add_watch.2: Add IN_ONLYDIR based error
I noticed that it was undocumented how inotify_add_watch(2)
behaves if IN_ONLYDIR is specified and the target is not a
directory.

I've included a patch that adds ENOTDIR as an additional error in
the inotify_add_watch(2) man page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-06 10:09:56 +02:00
Andrew Price abd34f349d open.2: Remove O_DIRECT-related quotation
Remove a section that adds no benefit to the discussion of O_DIRECT.

Signed-off-by: Andrew Price <andy@andrewprice.me.uk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-06 09:29:46 +02:00
Michael Kerrisk 0a719e9411 capabilities.7: tfix
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2018-05-02 21:16:20 +02:00