Commit Graph

20087 Commits

Author SHA1 Message Date
Michael Kerrisk ebf20cddae Changes: Expanded tabs 2019-05-09 09:43:55 +02:00
Michael Kerrisk 2e3023c413 execve.2, setfsgid.2, setfsuid.2, splice.2, fopen.3, malloc_trim.3, posix_memalign.3, stdarg.3, sysconf.3, tsearch.3, elf.5, hostname.7, inode.7: tstamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-09 09:43:09 +02:00
Michael Kerrisk f1aa88c2df Changes: Read for 5.01
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-09 09:36:19 +02:00
Jakub Wilk db2280ee7e console_codes.4: tfix
Add missing periods.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-06 15:04:33 -05:00
Jakub Wilk e224cfce33 console_codes.4: Document that \e[1;n] and \e[2;n] support 16 colors
Source: setterm_command() in drivers/tty/vt/vt.c

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-06 15:04:21 -05:00
Jakub Wilk 60ae21db4c intro.1, execve.2, getcontext.3, passwd.5, bpf-helpers.7: wfix
Use gender-neutral pronouns.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-06 14:49:18 -05:00
Michael Kerrisk e24b389ad8 twalk_r.3: New link to twalk(3) page
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:30:23 -05:00
Michael Kerrisk 2b6329ad13 tsearch.3: Minor tweak to Florian's patch
Use consistent argument names in twalk() and twalk_r().

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:24:35 -05:00
Michael Kerrisk befe2896c9 tsearch.3: Reformat twalk() and twalk_r() prototypes for easier readability
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:24:35 -05:00
Michael Kerrisk 9794feed8f tsearch.3: SYNOPSIS: clarify that twalk_r() requires _GNU_SOURCE
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:24:35 -05:00
Michael Kerrisk fe1a03f967 tsearch.3: Minor tweaks to Florian Weimer's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:24:35 -05:00
Florian Weimer 7c520948e2 tsearch.3: Document the twalk_r() function added in glibc 2.30
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:24:35 -05:00
Florian Weimer 06eef09b9c tsearch.3: Do not use const arguments in twalk() callback
The const specifier is not part of the prototype (it only applies to the
implementation), so showing it here confuses the reader.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 18:24:35 -05:00
Michael Kerrisk 14a848f0f1 sched_setaffinity.2: Correct details of return value of sched_getaffinity() syscall
Things changed a little with:

    commit cd3d8031eb4311e516329aee03c79a08333141f1
    Author: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Date:   Fri Mar 12 16:15:36 2010 +0900

Reported-by: Brice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 13:02:30 -05:00
Michael Kerrisk f19efb02df sysconf.3: Clearly note that _SC_PAGESIZE and _SC_PAGE_SIZE are synonyms
Reported-by: Hugues Evrard <hevrard@google.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 12:32:52 -05:00
Michael Kerrisk 263a6208f9 stdarg.3: Remove the NOTES section describing the ancient varargs macros
stdarg.h is now 30 years old, and gcc long ago (2004) ceased to
implement <varargs.h>. There seems little value in keeping this
text.

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

Reported-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 12:09:55 -05:00
Seth Troisi 60bcc5abdd CPU_SET.3: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 10:42:23 -05:00
Michael Kerrisk 3a66e3293d execve.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 07:36:37 -05:00
Michael Kerrisk 4a696f5ebd execve.2: Note that stack+environ size is also limited to 3/4 of _STK_LIM
In fs/exec.c::prepare_arg_pages(), we have:

        limit = _STK_LIM / 4 * 3;
        limit = min(limit, bprm->rlim_stack.rlim_cur / 4);

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 07:34:13 -05:00
Michael Kerrisk c7dc46d0a2 close.2: srcfix (comment on EINTR error)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 06:14:45 -05:00
Slavomir Kaslev 5ca397fa3e tee.2: EAGAIN can occur when called on nonblocking file descriptors
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 05:28:17 -05:00
Slavomir Kaslev 4b5e751062 splice.2: EAGAIN can occur when called on nonblocking file descriptors
Signed-off-by: Slavomir Kaslev <kaslevs@vmware.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-05 05:27:55 -05:00
Elliot Hughes 2cfdf8f8ee posix_memalign.3: Some functions set errno
True of bionic, glibc, and musl. (I didn't check elsewhere.)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-04 20:41:21 -05:00
Michael Kerrisk e4d720644d tsearch.3: SYNOPSIS: add missing definition of 'VISIT' type
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-04 17:54:23 -05:00
Florian Weimer 921e2cfd1f hostname.7: HOSTALIASES/search path processing is DNS-specific
Other NSS modules do not necessarily honor these settings.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-04 13:35:07 -05:00
Elliott Hughes 2eb8835a4d mallinfo.3: Further discourage use of mallinfo()
The BUGS section already explains why you need to be cautious
about using mallinfo, but given the number of bug reports we see
on Android, it seems not many people are reading that far. Call it
out up front.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-04 13:31:01 -05:00
Michael Kerrisk aa6e1bee0e mount_namespaces.7: Minor fix: remove a crufty sentence
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-04 07:58:17 -05:00
Michael Kerrisk 4954c465ef mount_namespaces.7: wfix: "parent directory" ==> "parent mount"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-05-04 07:57:39 -05:00
Michael Kerrisk 4727b7b062 setfsuid.2: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-25 16:06:50 -05:00
Michael Kerrisk a25ac17222 elf.5: A data segment does not have PF_X
Reported-by: Keegan Saunders <keeganwsaunders@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-15 17:09:32 +02:00
Michael Kerrisk 6ab62ed869 clone.2: CLONE_CHILD_SETTID has effect before clone() returns *in the child*
CLONE_CHILD_SETTID may not have had effect by the time clone()
returns in the parent, which could bre relevant if the
CLONE_VM flag is employed. The relevant kernel code is in
schedule_tail(), which is called in ret_from_fork()
in the child.

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

Demonstration using the program shown below (inspired by a simpler
example from Jakub):

$ ./a.out
parent start: ctid =     0    ptid =  6212
child start:  ctid =  6212    ptid =  6212
child later:  ctid =  6212    ptid =  6212
cat parent later: ctid =  6212    ptid =  6212
f.child -- bye

$ cat prog.c

static volatile pid_t ctid, ptid;

static int
child_fn(void *arg)
{
    printf("child start:  ctid = %5d    ptid = %5d\n", ctid, ptid);
    sleep(1);
    printf("child later:  ctid = %5d    ptid = %5d\n", ctid, ptid);
    sleep(2);
    printf("child -- bye\n");
    return 0;
}

int
main(void)
{
    void *stack = malloc(0x1000);
    char *stack_top = (char *) stack + 0x1000;
    int flags =  SIGCHLD | CLONE_VM |
                 // CLONE_VFORK |
                 CLONE_PARENT_SETTID | CLONE_CHILD_SETTID;

    if (clone(child_fn, stack_top, flags, NULL, &ptid, NULL, &ctid) == -1) {
        perror("clone");
        exit(EXIT_SUCCESS);
    }

    fprintf(stderr, "parent start: ctid = %5d    ptid = %5d\n", ctid, ptid);
    sleep(2);
    fprintf(stderr, "parent later: ctid = %5d    ptid = %5d\n", ctid, ptid);

    if (wait(NULL) == -1) {
        perror("wait");
        exit(EXIT_FAILURE);
    }

    exit(EXIT_SUCCESS);
}

Reported-by: Jakub Nowak <jakub.jakub.nowak@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-15 14:17:39 +02:00
Jakub Wilk 586bfb5dad getpt.3: tfix
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:34 +02:00
Lucas Werkmeister 001c282788 io_getevents.2: wsfix: fix stray tab
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:34 +02:00
Michael Kerrisk 09358e73ef malloc_trim.3: Minor fixes to Carlos's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:34 +02:00
Carlos O'Donell 0deebbe524 malloc_trim.3: Update trimming information
Since glibc 2.8, commit 68631c8eb92, the malloc_trim function has
iterated over all arenas and free'd back to the OS all page runs
that were free.  This allows an application to call malloc_trim to
consolidate fragmented chunks and free back any pages it can to
potentially reduce RSS usage.

This correctness of the man page was recently brought to light by
an article [1] where Ruby developers discovered that malloc_trim
did not behave as the man page indicated.

This change makes it clear that the intent of malloc_trim is to
trim all space that is no longer needed, and any restrictions are
implementation details. In the notes we highlight the change in
behaviour for post glibc 2.8 and pre glibc 2.8.

[1] https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html#a-magic-trick-trimming

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:34 +02:00
Michael Kerrisk 492a6a0d4a fopen.3: Minor tweaks to Elliot's patch
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:34 +02:00
enh d66e1f2be3 fopen.3: Explain BSD vs glibc "a+" difference
Where is the initial read position for an "a+" stream?

POSIX leaves this unspecified. Most BSD man pages are silent, and MacOS
has the ambiguous "The stream is positioned at the end of the file", not
differentiating between reads and writes other than to say that fseek(3)
does not affect writes. glibc's documentation explicitly specifies that
the initial read position is the beginning of the file.

My new wording is based on the BSD implementations, so you may prefer
to replace the non-glibc section with "unspecified", or indeed remove
all claims about the initial read position.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:34 +02:00
Michael Kerrisk ad484960cb stdarg.3: Add a note that ... in function signature means a variadic function
Egmont suggested adding this, because the string "..." appears
at several other points in the page, but just to indicate that
some text is omitted from example code.

Reported-by: Egmont Koblinger <egmont@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-14 19:12:27 +02:00
Michael Kerrisk 5ea5bb212b syscalls.2: Remove crufty text about i386 syscall dispatch table
The removed text long ago ceased to be accurate. Nowadays, the
dispatch table is autogenerated when building the kernel (via
the kernel makefile, arch/x86/entry/syscalls/Makefile).

Reported-by: Andreas Korb <andreas.d.korb@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-12 10:56:59 +02:00
Michael Kerrisk 2ef9216b22 bpf.2: Update kernel version info for JIT compiler
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-04-04 11:53:38 +02:00
Michael Kerrisk d478d0defe setfsgid.2: Rewrite for improved clarity and defer to setfsuid() for details
Rewrite for improved clarity and defer to setfsuid(2) for the
rationale of the fsGID rather than repeating the same details
in this page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-26 06:11:58 +01:00
Michael Kerrisk 5d3b92e534 setfsuid.2: Rewrite for improved clarity and to hint history more explicitly
The current text reads somewhat clumsily. Rewrite it to introduce
the eUID and fsUID in parallel, and more clearly hint at the the
historical rationale for the fsUID, which is detailed lower in
the page.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-26 05:58:54 +01:00
Abhinav Upadhyay 96ed2f3ff4 bpf.2: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-20 08:57:56 +01:00
Jakub Wilk c30acaebb9 man-pages.7: tfix
Escape hyphen.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-20 08:53:00 +01:00
Jakub Wilk 1caf9454ee man-pages.7: spfix
The section "Example Programs ..." was renamed to "Example programs ..."
(with lowercase p) in c634028ab5, but the reference was not
updated.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-20 08:52:43 +01:00
Jakub Wilk 4818bee547 core.5: tfix
Escape hyphens.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-20 08:50:24 +01:00
Michael Kerrisk 03349e33f9 accept.2: Note that 'addrlen' is left unchanged in the event of an error
See http://austingroupbugs.net/view.php?id=836.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-18 17:30:23 +01:00
Michael Kerrisk 1a29a70ded pipe.2: Note that 'pipefd' is left unchanged in the event of an error
See http://austingroupbugs.net/view.php?id=467.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-18 17:30:23 +01:00
Michael Kerrisk 1548a03a6b socketpair.2: Clarify that 'sv' is left unchanged in the event of an error
See also http://austingroupbugs.net/view.php?id=483.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-18 17:30:23 +01:00
Michael Kerrisk d08cb7ae9a inode.7: Add references to execve(2) to describe set-UID/set-GID behaviors
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-03-12 06:49:15 +01:00