Commit Graph

16891 Commits

Author SHA1 Message Date
Michael Kerrisk 6d654721b9 sock_diag.7: srcfix: rewrap long lines
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 15:19:40 +01:00
Michael Kerrisk 7133b8984b netlink.7: Rework position of NETLINK_SOCK_DIAG in list
Essentially to fix a formatting issue, where the list head
item wrapped past the 80-column limit when rendered.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 15:19:40 +01:00
Dmitry V. Levin 77a7e0e2bf netlink.7: Add references to sock_diag(7)
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 15:19:40 +01:00
Dmitry V. Levin 407bcead83 netlink.7: Document NETLINK_INET_DIAG rename to NETLINK_SOCK_DIAG
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 15:19:40 +01:00
Pavel Emelyanov 4f6a0a4a90 sock_diag.7: New page documenting NETLINK_SOCK_DIAG interface
Co-authored-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 15:19:40 +01:00
Dmitry V. Levin 34caa2222e netlink.7: ffix
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 15:19:40 +01:00
Michael Kerrisk d24623ee57 close.2: Note that future POSIX plans to require that the FD is closed on error
See http://austingroupbugs.net/view.php?id=529#c1200.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 08:28:29 +01:00
Michael Kerrisk e8730f0ee7 close.2: Further reworking of discussion of error return from close()
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-07 08:26:44 +01:00
Michael Kerrisk ca734d5b67 close.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:52:43 +01:00
Michael Kerrisk 1cab7c163d close.2: Further clarify how to treat an error return
Further clarify that an error return should be used only
for diagnostic or remedial purposes.

Lifting Linus's words freely from
http://lkml.iu.edu/hypermail/linux/kernel/0207.2/0409.html
Re: close return value (was Re: [ANNOUNCE] Ext3 vs Reiserfs benchmarks)
Date: Wed Jul 17 2002 - 12:43:57 EST

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:52:43 +01:00
Michael Kerrisk 7fe8ca51a3 close.2: Other UNIX implementations also close the FD, even if reporting an error
Looking at some historical source code (mostly from [1]) suggests
that the "close() always closes regardless of error return"
behavior has a long history, predating even POSIX.1-1990.

For example, in SVR4 for x86 (from the file sysvr4.tar.bz2 at
[1]), we see the following:

        int
        close(uap, rvp)
                register struct closea *uap;
                rval_t *rvp;
        {
                file_t *fp;
                register int error;

                if (error = getf(uap->fdes, &fp))
                        return error;
                error = closef(fp);
                setf(uap->fdes, NULLFP);
                return error;
        }

In the above, getf() can return EBADF. The other errors are
returned by closef(), but the file descriptor is deallocated
regardless of errors by setf().

A similar pattern seems to have been preserved into at least late
OpenSolaris days (verified from looking at the initial commit of
the illumos source code). There we find the following in
closeandsetf() (called by close()):

        error = closef(fp);

        setf(fd, newfp);

        return (error);

Looking at the code of closef() in AIX 4.1.3 suggests that, as on
on Linux and FreeBSD, the open file is always released, regardless
of errors.

For Irix, 6.5.5, I'm not sure (the code is not so easy to quickly
read); it may be that it does return errors while leaving the FD
open.

[1] https://archive.org/download/various_operating_system_source_code

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:52:16 +01:00
Michael Kerrisk 7155aa7750 close.2: Minor text reworking
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:16:31 +01:00
Michael Kerrisk 73c922eac8 close.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:16:31 +01:00
Michael Kerrisk 35e0ce1c58 close.2: Minor text relocation
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:16:31 +01:00
Michael Kerrisk b36a3b92b6 close.2: Clarify the variation in EINTR behavior per POSIX and other systems
See also https://news.ycombinator.com/item?id=3363819
and http://www.daemonology.net/blog/2011-12-17-POSIX-close-is-broken.html

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 16:16:28 +01:00
Michael Kerrisk eb74a52bb5 close.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 15:13:57 +01:00
Michael Kerrisk b61a87d567 close.2: Rework initial paragraph in NOTES on checking close() errors
As Daniel Wagner noted, saying on the one hand that failing
to check the return value of close() is a "serious error"
seems contradicted by the next paragraph that notes that
the return value should be used for "just diagnostics".
Rework the text to resolve the apparent contradiction.

Reported-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 15:13:57 +01:00
Michael Kerrisk f65f00b085 close.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 15:00:59 +01:00
Carlos O'Donell dd9454a654 resolv.conf.5: Timeout does not map to resolver API calls
I'm posting this patch to clarify the timeout behaviour because
there have been developers who expect this timeout to mean
something it is not.

The timeout (and by proxy attempts) does not map to resolver API
calls.  For example a single call to getent might involve multiple
resolution requests to the resolvers listed in resolv.conf and
each request will use TIMEOUT and be attempted at least ATTEMPT
times. A developer using the resolver API cannot easily compute
any given timeout because the implementation may change e.g. A and
AAAA queries made in parallel.  A system administrator uses this
setting to ensure there is a desirable timeout on any request to
any of the nameservers listed in resolv.conf, but no guarantees
exist beyond that.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-06 11:40:16 +01:00
Michael Kerrisk f5f4165105 mmap.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:07:12 +01:00
Michael Kerrisk eaa8868c7b strerror.3: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:02:06 +01:00
Michael Kerrisk 00d82ce875 open.2: srcfix: FIXME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:02:06 +01:00
Michael Kerrisk 97d8fd295f ptsname.3: Note that ptsname_r() is proposed for future inclusion in POSIX.1
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:02:06 +01:00
Michael Kerrisk b078637007 ptsname.3: CONFORMING TO:: clarify that only ptsname() is standardized (so far)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:02:06 +01:00
Michael Kerrisk 2904e19a2b close.2: Further clarify that close() should not be retried after an error
See Linus ancient comments re EINTR in
    https://lkml.org/lkml/headers/2005/9/10/129
    Date	Sat, 10 Sep 2005 12:00:01 -0700 (PDT)
    From	Linus Torvalds <>
    Subject	Re: [patch 7/7] uml: retry host close() on EINTR

The FreeBSD 11.0 close() man page says similar:

    In case of any error except EBADF, the supplied file
    descriptor is deallocated and therefore is no longer valid.

For AIX:
http://publib16.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf1/close.htm

    If the FileDescriptor parameter refers to a device and the
    close subroutine actually results in a device close, and the
    device close routine returns an error, the error is returned
    to the application. However, the FileDescriptor parameter is
    considered closed and it may not be used in any subsequent
    calls.

See also:
http://austingroupbugs.net/view.php?id=529
and in particular:
http://austingroupbugs.net/view.php?id=529#c1200

Reported-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 16:02:06 +01:00
Michael Kerrisk 2f3db2a58f symlink.7: SEE ALSO: add namei(1)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:31:37 +01:00
Michael Kerrisk def79251d4 credentials.7: SEE ALSO: add shadow(5)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:28:21 +01:00
Michael Kerrisk 540038a17d nice.2: Move discussion of handling the -1 success return to RETURN VALUE
This detail was rather hidden in NOTES. Also, rework the text
a little.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 226f6909f0 nice.2: CONFORMING TO: Remove an ancient SVr4 detail on errno values
At this stage, vague details (when does EINVAL get returned?) of
ancient implementations are little more than noise in the page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 32ff480294 nice.2: Rework discussion of nice() return value and standards conformance
Make the text a little clearer. In particular, clarify that the
raw system call (still) returns 0 on success.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 52694f0979 nice.2: Add mention of RLIMIT_NICE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 360c190092 signal.7: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 384c705b19 getrlimit.2: Refer to sched(7) in discussion of RLIMIT_RTPRIO and RLIMIT_RTTIME
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk a67b298f5c getrlimit.2: SEE ALSO: add credentials(7)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk dfc3c7dedc getrlimit.2: refer to sched(7) in the discussion of RLIMIT_NICE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk bbc069dd5b getrlimit.2: Minor wording fix for RLIMIT_NICE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk d17de8336c getrlimit.2: Describe the range of the RLIMIT_NICE limit
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk b5bde13cbc setsid.2: SEE ALSO: add sched(7)
List sched(7), because setsid(2) is part of the machinery
of autogrouping.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Kees Cook 998f951bf8 bpf.2: tfix
Changed to "will" instead of "with".

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 1af83f4a7a nice.2: Warn that autogrouping voids the effect of 'nice' in many cases
Refer the reader to sched(7) for the details.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk ccc127001c getpriority.2: Warn that autogrouping voids the effect of 'nice' in many cases
Refer the reader to sched(7) for the details.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk b7171b1495 sched.7: Clarify that autogroup defaults on in various distros
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk 58543181f8 sched.7: Note command that can be used to modify the autogroup nice value
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-12-05 12:13:33 +01:00
Michael Kerrisk a695d35c98 sched.7: Improve section on nice value and group scheduling
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-30 18:30:54 +01:00
Michael Kerrisk 4fbe161bf2 sched.7: Relocate discussion of group scheduling
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-30 18:30:54 +01:00
Michael Kerrisk 7ef1473742 sched.7: Clarify details of autogroup nice value
Also clarify its interactions with the thread nice value.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-30 18:30:36 +01:00
Michael Kerrisk c49631b7de sched.7: srcfix: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 21:50:15 +01:00
Michael Kerrisk 0cacdedace sched.7: Further clarify scheduling policies for which autogroup applied
Further clarify that autogroup groups only SCHED_OTHER/SCHED_NICE/
SCHED_IDLE processes.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 21:50:15 +01:00
Michael Kerrisk e92070f8cc sched.7: Add a subsection on group scheduling
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 21:50:15 +01:00
Michael Kerrisk e9c1649aa7 sched.7: Tweak description of cgroups overriding autogroup
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 21:50:15 +01:00