aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-03-01clone.2: Note EINVAL when exit_signal + bad flagsJack Pearson1-0/+10
Document that Linux will report EINVAL when exit_signal is specified and either CLONE_THREAD or CLONE_PARENT is specified. From clone3_args_valid in Linux: ``` if ((kargs->flags & (CLONE_THREAD | CLONE_PARENT)) && kargs->exit_signal) return false; ``` I have verified that this happens on my kernel with a small program: ``` #include <stdio.h> #include <linux/sched.h> #include <signal.h> #include <sys/syscall.h> #include <unistd.h> int main(void) { struct clone_args ca = { .flags = CLONE_THREAD | CLONE_SIGHAND | CLONE_VM, .exit_signal = SIGCHLD, // comment me out to fix error .set_tid_size = 0, }; syscall(SYS_clone3, &ca, sizeof(struct clone_args)); perror(""); } ``` And I have verified that this doesn't happen with normal `clone` through the glibc helper: ``` #define _GNU_SOURCE #include <sched.h> #include <signal.h> #include <stdio.h> #include <sys/mman.h> int do_nothing(void *_) { return 0; } int main(void) { void *map = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); void *stack_top = map + 0x10000 - 1; clone(do_nothing, stack_top, CLONE_THREAD | CLONE_VM | CLONE_SIGHAND | SIGCHLD, NULL); perror(""); } ``` Signed-off-by: Jack Pearson <jack@pearson.onl> Cc: "Carlos O'Donell" <carlos@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-01ptrace.2: Add details about usage of PTRACE_GET_SYSCALL_INFOFotios Valasiadis1-0/+9
Document the role of PTRACE_O_TRACESYSGOOD option in connection with PTRACE_GET_SYSCALL_INFO. Came upon this after writing a test program using PTRACE_GET_SYSCALL_INFO. After failing to find what's wrong I posted a StackOverflow question which you can find right here: <https://stackoverflow.com/questions/72410182/ptrace-get-syscall-info-always-returns-info-op-as-ptrace-syscall-info-none> Nate Eldredge found out what happens by looking into the kernel's source code, here is a link to the relevant part <https://github.com/torvalds/linux/blob/8291eaafed36f575f23951f3ce18407f480e9ecf/kernel/ptrace.c#L1018> In the code it can be seen that in case of system call entry or exit stops, the union is filled if and only if the signal matches `SIGTRAP | 0x80`, a signal which is only sent if the PTRACE_O_TRACESYSGOOD option is set. You can read about that in the PTRACE_O_TRACESYSGOOD section of ptrace(2)'s manual. Complements: fc91449cb "ptrace.2: Document PTRACE_GET_SYSCALL_INFO" Cowritten-by: Dmitry V. Levin <ldv@strace.io> Signed-off-by: Dmitry V. Levin <ldv@strace.io> Signed-off-by: Fotios Valasiadis <fvalasiad@gmail.com> Acked-by: Nate Eldredge <nate@thatsmathematics.com> Cc: Elvira Khabirova <lineprinter0@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-26suffixes.7: Add .js and .ts extensionsAlejandro Colomar1-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-25malloc.3: EXAMPLES: Add example program with mallocarray() and macrosAlejandro Colomar1-0/+32
mallocarray() is safer than malloc(3), since it checks for overflow; it should be preferred almost always (with the exception of non-arrays maybe). The macros like MALLOCARRAY() --and MALLOC()-- that perform automatic casting and sizeof() are also safer than calling the functions directly: - The type of the allocated object (not the pointer) is specified as an argument, which improves readability: - It is directly obvious what is the type of the object just by reading the macro call. - It allows grepping for all allocations of a given type. This is admittedly similar to using sizeof() to get the size of the object, but we'll see why this is better. - In the case of reallocation macros, an extra check is performed to make sure that the previous pointer was compatible with the allocated type, which can avoid some mistakes. - The cast is performed automatically, with a pointer type derived from the type of the object. This is the best point of this macro, since it does an automatic cast, where there's no chance of typos. Usually, programmers have to decide whether to cast or not the result of malloc(3). Casts usually hide warnings, so are to be avoided. However, these functions already return a void *, so a cast doesn't really add much danger. Moreover, a cast can even add warnings in this exceptional case, if the type of the cast is different than the type of the assigned pointer. Performing a manual cast is still not perfect, since there are chances that a mistake will be done, and even ignoring accidents, they clutter code, hurting readability. And now we have a cast that is synced with sizeof. - Whenever the type of the object changes, since we perform an explicit cast to the old type, there will be a warning due to type mismatch in the assignment, so we'll be able to see all lines that are affected by such a change. This is especially important, since changing the type of a variable and missing to update an allocation call far away from the declaration is easy, and the consequences can be quite bad Apart from those benefits, there are other minor style benefits: - Consistency in getting the size of the object from sizeof(type), instead of a mix of sizeof(type) sometimes and sizeof(*p) other times. - More readable code: no casts, and no sizeof(), so also shorter lines that we don't need to cut. - Consistency in using array allocation calls for allocations of arrays of objects, even when the object size is 1. Link: <https://github.com/shadow-maint/shadow/pull/649> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: "Valentin V. Bartenev" <vbartenev@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-25setpgid.2: ERRORS: Add EPERM for nonexisting process groupGuy Shefy1-0/+5
Reproduced using test program: #include <stdio.h> #include <sys/types.h> #include <unistd.h> int main(void) { pid_t pid_a, pid_b; pid_a = fork(); printf("pid: %i; pgid: %i; forkA: %i\n", (int) getpid(), (int) getpgrp(), (int) pid_a); if (!pid_a) { // pid_a is not a valid process group // setpgid(0, 0); // This makes it succeed. sleep(1); // stay alive return 0; } pid_b = fork(); if (!pid_b) { printf("* pid: %i; pgid: %i; forkA: %i; forkB: %i\n", (int)getpid(), (int)getpgrp(), (int)pid_a, (int)pid_b); setpgid(0, pid_a); perror("setpgid"); return 0; } printf("pid: %i; pgid: %i; forkA: %i; forkB: %i\n", (int) getpid(), (int) getpgrp(), (int) pid_a, (int) pid_b); sleep(1); // stay alive return 0; } Signed-off-by: Guy Shefy <guyshefyb@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-25landlock.7: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-25landlock.7: Move the warning about missing features into the CAVEATS sectionGünther Noack1-1/+1
Putting the warning there makes it more prominent. CAVEATS is a standard section that exists in many man pages and is also described in man-pages(7). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-15sscanf.3: RETURN VALUE: These functions don't use a streamAlejandro Colomar1-7/+0
This text I forgot to remove it when the page was split from scanf(3). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-15printf.h.3head: ffixAlejandro Colomar1-3/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-15memcmp.3: wfixTom Schwindl1-1/+1
Link: <https://lore.kernel.org/linux-man/27264e6b-bc50-f772-f8d5-1abc4ebcbe62@gmail.com/T/> Signed-off-by: Tom Schwindl <schwindl@posteo.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12Start of man-pages-NEXT: Move Changes to Changes.oldAlejandro Colomar2-148/+189
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12lsm: Released 6.03Alejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12Changes: Ready for 6.03man-pages-6.03Alejandro Colomar1-2/+148
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12_Generic.3: Remove example codeAlejandro Colomar1-89/+0
Casting sockaddr structures is just a symptom that these APIs were seriously misdesigned. In GNU C, there's already a better way to handle this (see [[gnu::transparent_union]]). ISO C should be fixed. Let's not promote this kind of code. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12printf.h.3head: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12man2/: use consistent closed interval notation for value rangesBrian Inglis6-8/+8
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-12PA_CHAR.3const, PA_DOUBLE.3const, PA_FLAG_LONG.3const, ↵Alex Colomar14-0/+14
PA_FLAG_LONG_DOUBLE.3const, PA_FLAG_LONG_LONG.3const, PA_FLAG_PTR.3const, PA_FLAG_SHORT.3const, PA_FLOAT.3const, PA_INT.3const, PA_LAST.3const, PA_POINTER.3const, PA_STRING.3const, PA_WCHAR.3const, PA_WSTRING.3const: Add links to printf.h(3head) Cc: Walter Harms <wharms@bfs.de> Cc: <Radisson97@gmx.de> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: <libc-alpha@sourceware.org> Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
2023-02-12printf_arginfo_size_function.3type, printf_function.3type, ↵Alex Colomar4-0/+4
printf_info.3type, printf_va_arg_function.3type: Add links to printf.h(3head) Cc: Walter Harms <wharms@bfs.de> Cc: <Radisson97@gmx.de> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: <libc-alpha@sourceware.org> Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
2023-02-12register_printf_specifier.3, register_printf_modifier.3, ↵Alex Colomar3-0/+3
register_printf_type.3: Add links to printf.h(3head) Cc: Walter Harms <wharms@bfs.de> Cc: <Radisson97@gmx.de> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: <libc-alpha@sourceware.org> Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
2023-02-12printf.3head: Document functions for customizing printf(3)-like functionsAlex Colomar1-0/+581
Suggested-by: Walter Harms <wharms@bfs.de> Cc: <Radisson97@gmx.de> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: <libc-alpha@sourceware.org> Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
2023-02-10units.7: srcfix (\(mc -> \[mc])G. Branden Robinson1-1/+1
Use correct *roff special character for micro sign. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10adjtimex.2: srcfixG. Branden Robinson1-5/+1
* Stop manipulating adjustment and hyphenation around a table. * These could be safely done within the text block, but even that is not necessary, since what is in the next block is a single word, so no adjustment will take place, and to prevent hyphenation of a single word, \% is cheap and straightforward. So do that. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10localedef.1: srcfixG. Branden Robinson1-20/+39
Break input lines after commas and semicolons. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10localedef.1: ffixG. Branden Robinson1-13/+20
Rewrite synopses to use groff man(7) `SY`/`YS` extension macros. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10localedef.1: ffixG. Branden Robinson1-4/+0
Stop manipulating adjustment and hyphenation. Forcibly re-enabling adjustment to both margins after the synopsis does not respect user configuration of adjustment. There _is_ a portable way to save the adjustment mode, via the .j register and a copy of it, but doing so requires even more usage of low-level requests that are discouraged in man page writing. The latter is incorrect for use with groff(1) since '.hy' does not restore the previous hyphenation mode but sets it to 1, which is not appropriate for the English-language hyphenation patterns groff uses. (Also, AT&T man(7) used a hyphenation mode of 14.) Neither of these requests is respectful of user configuration of adjustment or hyphenation enablement. Features in the forthcoming groff 1.23 will make these easier for users to manipulate to their preference. (mandoc(1) does not support configurable adjustment or hyphenation, so all of these requests are no-ops for it.) Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10vdso.7: fix deadlinks to Linux Documentation/наб1-5/+5
Respectively: commit dc7a12bdfccd94c31f79e294f16f7549bd411b49 ("docs: arm: convert docs to ReST and rename to *.rst") commit db9a0975a20c1f21c108b9d44545792d790593e4 ("docs: ia64: convert to ReST") commit e77e9187ae1caf2d83dd5e7f0c1466254b644a4c ("docs: parisc: convert to ReST and add to documentation body") Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10times.2: ffixG. Branden Robinson1-1/+1
Use \[lq] and \[rq] special characters for prose quotation marks. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10times.2: srcfixG. Branden Robinson1-14/+33
Break input lines after commas. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10quotactl.2: ffixG. Branden Robinson1-1/+1
Use \- for minus sign instead of - (hyphen), producing better typography on typesetting devices and Unicode terminals. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10close_range.2: srcfix (~ -> \[ti])G. Branden Robinson1-2/+2
Use correct *roff special character for ("ASCII") tilde. There are other occurrences in bpf-helpers.7, but those will have to await improvement of the tool that generates man(7) from the source language. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10man*/: srcfix (^ -> \[ha])G. Branden Robinson20-63/+63
Use correct *roff special character for hat/caret/circumflex accent. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10ioctl_fat.2: srcfixG. Branden Robinson1-2/+2
Remove unportable hack to put a dot at the beginning of an input line. Use the idiomatic means of doing this instead: the roff dummy character escape sequence. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10prctl.2: srcfixG. Branden Robinson1-1/+1
Remove spurious escaping of '.' where it cannot be interpreted as a roff control character. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10sched.7: srcfixG. Branden Robinson1-4/+4
Fix warnings from formatter. troff:./man7/sched.7:989: warning [p 10, 2.7i]: cannot adjust line troff:./man7/sched.7:990: warning [p 10, 2.8i]: cannot adjust line Add hyphenless break points to file names, but also suppress hyphenation to reduce copy-and-paste frustration. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-10man2/: srcfix (hyphens used as C operators)G. Branden Robinson6-17/+17
Escape hyphens used as parts of C `->` operators. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-08getrandom.2: Change limit to use IEC multiple symbolBrian Inglis1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-08reboot.2: Show BCD dates in hex not decimalBrian Inglis1-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-08spu_run.2: Fix example comment status code or-ed valueBrian Inglis1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-08shmget.2: Fix limit units prefix symbol from SI to IECBrian Inglis1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-08perf_event_open.2: Add missing variable nameNamhyung Kim1-1/+1
Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-08persistent-keyring.7: wfixJakub Wilk1-2/+2
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-06units.7: Add break points in URIAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-06units.7: Fix escapes (\-) in URIAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05units.7: Use \[mc] instead of \(mcAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05prctl.2, man.7: Use \[ga] instead of \(gaAlejandro Colomar2-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05prctl.2: Use \[cq] instead of \(cqAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05prctl.2: Use \[oq] instead of \(oqAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[bu] instead of \(buAlejandro Colomar167-1506/+1506
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Various pages: Use \[rq] instead of \(rqAlejandro Colomar13-26/+26
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Various pages: Use \[lq] instead of \(lqAlejandro Colomar13-26/+26
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[ha] instead of \(haAlejandro Colomar33-84/+84
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[ti] instead of \(tiAlejandro Colomar39-52/+52
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[em] instead of \(emAlejandro Colomar100-178/+178
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[en] instead of \(enAlejandro Colomar24-72/+72
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05man-pages.7: Recommend using \[..] instead of \(.. escapesAlejandro Colomar1-5/+5
They are more readable. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05EOF.3const: ffixAlejandro Colomar1-1/+1
Reported-by: наб <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05timespec.3type: tv_nsec is impl-def-type, glibc llong not a bugнаб1-33/+17
n3091 accepts n3066, making it part of the next working draft and C23: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3091.doc Update timespec.3type appropriately, largely mirroring my paper. Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[dq] instead of \(dqAlejandro Colomar9-61/+61
This improves readability in the source code, since it delimits where the escape sequence ends. Cc: наб <nabijaczleweli@nabijaczleweli.xyz> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use \[aq] instead of \(aqAlejandro Colomar221-831/+831
This improves readability in the source code, since it delimits where the escape sequence ends. Cc: наб <nabijaczleweli@nabijaczleweli.xyz> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05Many pages: Use lowercase for 'glibc'Alejandro Colomar215-314/+314
It's a proper noun, whose original letter case should be respected. glibc's own documentation uses always lowercase; let's do the same here. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05sscanf.3: BUGS: Document the UB in some conversion specifiersAlejandro Colomar1-0/+19
This is a bug in the standards, but implementation should not follow the standard in this case. Link: <https://lore.kernel.org/linux-man/20221208123454.13132-1-abbotti@mev.co.uk/T/#u> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Zack Weinberg <zack@owlfolio.org> Cc: Joseph Myers <joseph@codesourcery.com> Cc: Eric Biggers <ebiggers@kernel.org> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05namespaces.7: ffixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05regex.3: tfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05charsets.7: wfixAlejandro Colomar1-4/+4
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05perf_event_open.2: Update recent changesNamhyung Kim1-8/+199
Add missing perf_event_attr fields, new event codes and sample type. Also add descriptions for PERF_FORMAT_LOST. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05landlock.7: tfixGünther Noack1-1/+1
Signed-off-by: Günther Noack <gnoack3000@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-05landlock.7: ffixGünther Noack1-1/+2
Signed-off-by: Günther Noack <gnoack3000@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-01vdso.7: Fix risc-v symbol names.Elliott Hughes1-6/+6
The kernel git history says the names have always been "__vdso_" rather than "__kernel_", so I assume this was a copy & paste mistake from a different architecture. Luckily, the path to the kernel source that lets you confirm/deny this _is_ correct :-) Signed-off-by: Elliott Hughes <enh@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-31bpf-helpers.7: Refresh pageAlejandro Colomar1-59/+376
See commit 19c7f78393f2 ("bpf-helpers.7: Refresh page") Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-31intN_t.3type: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-29charsets.7: wfixAlejandro Colomar1-1/+1
Several of the languages mentioned are not West Europe. Some come from the North, South, or East. Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26cppcheck.suppress, lint-c.mk: lint-c-cppcheck: Add cppcheck(1) to the C lintersAlejandro Colomar2-1/+25
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26getdents.2: EXAMPLES: Fix printf() conversion specifierAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26fopencookie.3: EXAMPLES: Fix memory leakAlejandro Colomar1-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26seccomp_unotify.2: EXAMPLES: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26getdate.3: EXAMPLES: Fix printf() conversion specifierAlejandro Colomar1-1/+1
Fixes: b42296e4 "Various pages: EXAMPLES: Use unsigned types for loop iterators" Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26pthread_setschedparam.3: EXAMPLES: Don't assign unused valueAlejandro Colomar1-1/+1
We're not reading the value after it's set. And I just checked that that function can't fail for reasonable input. Reported-by: cppcheck(1) Reported-by: `make lint-c-cppcheck` Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26tsearch.3: EXAMPLES: Don't else after noreturnAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26stpncpy.3: EXAMPLES: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26rpmatch.3: EXAMPLES: Use _DEFAULT_SOURCE instead of _SVID_SOURCEAlejandro Colomar1-1/+1
_SVID_SOURCE is deprecated. Show how a program should be written today. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26static_assert.3: srcfixAlejandro Colomar1-0/+1
Add missing ." SRC END comment. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26build-src.mk: CFLAGS: Add -Wdeclaration-after-statementAlejandro Colomar1-0/+2
This helps write more readable code, separating variable declarations from code. In some cases, when initializing structs, or declaring some VLAs, we can't follow the rule, so don't make it an error. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-26Various pages: EXAMPLES: Fix -Wdeclaration-after-statement errorsAlejandro Colomar3-9/+13
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22Various pages: wfixAlejandro Colomar12-21/+23
Fixes: b324e17d3208 ("Many pages: wfix") Reported-by: Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22getpid.2: tfixAlejandro Colomar1-1/+1
Reported-by: Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22_exit.2: tfixAlejandro Colomar1-1/+1
Reported-by: Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22ttytype.5: ffixAlejandro Colomar1-1/+2
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22user_namespaces.7: ffixAlejandro Colomar1-5/+5
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22string.3: wfixAlejandro Colomar1-2/+2
Use consistent syntax for 'dest' vs 'dst' in string(3). Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22session-keyring.7: SEE ALSO: refer to PAM(7)Alejandro Colomar1-0/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blaettermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22nfsservctl.2: ffixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: mario.blaettermann@gmail.com Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-22socket.7: tfixJan Engelhardt2-8/+8
The .TP macro is followed by exactly one line of definition, and then multiple lines of flowed explanatory text. When flowed, the lack of periods is apparent in sentences. Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-19getnameinfo.3: SYNOPSIS: Add missing _Nullable qualifiersAlejandro Colomar1-2/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-19roundup.3: New page documenting roundup(3)Alejandro Colomar1-0/+56
Cc: Paul Eggert <eggert@cs.ucla.edu> Cc: Wilco Dijkstra <Wilco.Dijkstra@arm.com> Cc: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-15units.7: Remove references to NISTAlejandro Colomar1-11/+0
The SI brochure is the reference. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-15units.7: Add decimal and binary prefixesAlejandro Colomar1-0/+6
The SI added prefixes for 10^(+-)27 and 30 in 2022. While updating this, I realized that we were missing Zi and Yi, which are specified by the SI, I guess since a long time ago. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-11prctl.2, proc.5: Document VMA namingNick Gregory2-0/+48
Bring in man page changes from the patch set by Colin Cross, and document the corresponding virtual names in procfs. Link: <https://lore.kernel.org/linux-mm/20211019215511.3771969-2-surenb@google.com/> Signed-off-by: Nick Gregory <nick@nickgregory.me> Reviewed-by: Suren Baghdasaryan <surenb@google.com> Cc: Colin Cross <ccross@google.com> Cc: Kees Cook <keescook@chromium.org> Cc: Pasha Tatashin <tatashin@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07intro.3: ffixG. Branden Robinson1-1/+3
Set "feature test macros" in italics when introducing it as a technical term. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07intro.3: srcfixG. Branden Robinson1-15/+27
* Break input lines at phrase boundaries more often. * Break input lines after commas. * Set multi-word parentheticals on their own input lines. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07libc.7: ffixG. Branden Robinson1-5/+6
* Use typographer's quotation marks instead of '"' for quotation. * Hyperlink the text "GNU C Library" to its website. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07ldconfig.8: Drop discussion of libc4,5 support.G. Branden Robinson1-34/+3
Drop multiple paragraphs discussing libc4 and libc5 shared library support. It was removed upstream in July; annotate commit. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07Many pages: TH: Use lowercaseAlejandro Colomar53-53/+53
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07.gitignore: Ignore checkpatch(1) output fileAlejandro Colomar1-0/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07ldconfig.8: wfixG. Branden Robinson1-14/+12
* Promote a parenthetical to primary discussion. 64-bit systems are the norm nowadays. * Perform a Kemper notectomy. That is, stop saying "note that" followed by some declarative statement. This trope is all over Unix documentation and I even see it in ISO standards. The latter doesn't serve to recommend it; as Dave Kemper has pointed out, everything we put in technical documentation should be worthy of note unless placed in a footnote, marked as "unnecessary on a first reading", or similar. It is the exception, not the rule. If you feel the need to say "note that", consider what adjacent material you shouldn't be saying at all. * Say "symbolic link" instead of "symlink". * When one sentence explains the previous, use a semicolon. * Place the modifier "only" more carefully. * Recast option descriptions to be in the imperative mood. * Recast file descriptions to use the paragraph tag as the subject of the first sentence. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07ldconfig.8: ffixG. Branden Robinson1-24/+44
* Set page topic in lowercase. * Rewrite synopses to use groff man(7) `SY`/`YS` extension macros. * Rewrite synopses to use man(7) font macros instead of *roff font selection escape sequences. * In synopses, set ellipses as separate "operands" to better suggest argument separation by white space. * In synopses, prevent breaks within option brackets. * Typeset ellipses more attractively on troff devices. * Rewrite option list to use man(7) font macros instead of *roff font selection escape sequences. * Use groff man(7) `TQ` extension macro to include multiple tags for options with long synonyms instead of comma notation. * Set literals used as arguments to `-c` option in bold, not italics. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07libc.7: srcfixG. Branden Robinson1-14/+26
* Set multi-word parentheticals on their own input lines. * Break input lines after commas. * Add hyphenless break points to URLs. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07ldconfig.8: Sort options in synopsisG. Branden Robinson1-1/+1
Sort options in English lexicographic order (aAbBcC...). Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07ldconfig.8: srcfixG. Branden Robinson1-30/+44
* Drop stale FIXME annotation regarding commit ID for `-i` option. * Drop redundant `PD` macro calls. * Break input lines after commas. * Set multi-word parentheticals on their own input lines. * Break input lines at phrase boundaries more often. * Protect literals from automatic hyphenation with `\%` escape sequence. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-07bcmp.3, memcmp.3, strcasecmp.3, strcmp.3, strcoll.3, strxfrm.3: Deprecate ↵Alejandro Colomar6-59/+6
bcmp(3) It is identical to memcmp(3). Use that. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-05arc4random.3: Raise the severity of the CAVEATS to BUGSAlejandro Colomar1-2/+2
This is a misdesign that the original OpenBSD developers fail to acknowledge. Link: <https://inbox.sourceware.org/libc-alpha/068b01c4-d0c4-0849-eabb-09c020a1480b@gmail.com/T/> Cc: "Jason A. Donenfeld" <Jason@zx2c4.com> Cc: Arsen Arsenović <arsen@aarsen.me> Cc: Sam James <sam@gentoo.org> Cc: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-05memchr.3: Deprecate rawmemchr(3)Alejandro Colomar1-16/+12
It is not optimized, and it calls either strlen(3) or memchr(3), so the caller can do it directly, and it will be better. Suggested-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-05index.3, memchr.3, strchr.3, string.3, strpbrk.3, strsep.3, strspn.3, ↵Alejandro Colomar9-73/+16
strstr.3, strtok.3: Deprecate index(3) and rindex(3) They are identical to strchr(3) and strrchr(3). Use those. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-04timespec.3type: tfixThomas Weißschuh1-1/+1
The field is correctly called "tv_nsec" as it is also used in other places in the manpage. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-02man-pages.7: Add preferred term "symbolic link".G. Branden Robinson1-0/+1
...per discussion with Alex Colomar. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-02path_resolution.7: wfixG. Branden Robinson1-5/+7
Not counting function names and cross references to the symlink(7) page, "symbolic link" is preferred to "symlink" in existing pages by a ratio of about 380 to the handful in this page. Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-02execveat.2: SYNOPSIS: Use the glibc prototypeAlejandro Colomar1-2/+2
Glibc provides a wrapper with slightly different types (regarding const). Show the wrapper, which is what users will interface with. Reported-by: Mark Galeck <markgaleck@gmail.com> Cc: Florian Weimer <fweimer@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-02intro.3: tfixG. Branden Robinson1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-02arc4random.3: Be consistent in uses of pseudorandomAlejandro Colomar1-5/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-01arc4random_buf.3, arc4random_uniform.3: Add links to arc4random(3)Alejandro Colomar2-0/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-01-01arc4random.3: New page documenting the arc4random(3) family of functionsAlejandro Colomar1-0/+104
arc4random(3) arc4random_uniform(3) arc4random_buf(3) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-31powerof2.3: New page documenting powerof2(3)Alejandro Colomar1-0/+46
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-31bstring.3: bcopy(3)'s replacement is memmove(3), not memcpy(3)Alejandro Colomar1-1/+1
Reported-by: Aaron Peter Bachmann <aaron_ng@inode.at> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-31bstring.3: bzero(3) is not deprecated in my bookAlejandro Colomar1-6/+4
It is technically superior to memset(3) in every way. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-30scripts: tfixSamanta Navarro2-6/+6
Typos found with codespell. Signed-off-by: Samanta Navarro <ferivoz@riseup.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-30bpf-helpers.7, open_how.2type, string_copying.7: tfixSamanta Navarro3-5/+5
Typos found with codespell. Signed-off-by: Samanta Navarro <ferivoz@riseup.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-30rand.3: SYNOPSIS: Mark rand_r() as deprecatedAlejandro Colomar1-1/+2
POSIX.1-2008 says so, and it's not a very useful function either. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-29memchr.3: The function always returns a pointer to the matchAlejandro Colomar1-2/+1
Otherwise, it means we're deep into UB lands, and there be dragons. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-29rand.3: EXAMPLES: Show how to get a random seedAlejandro Colomar1-0/+8
This is useful when testing many different cases, but repeatability is more important than quality of the random numbers. Cc: Jonny Grant <jg@jguk.org> Cc: Cristian Rodríguez <crrodriguez@opensuse.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-29Many pages: Remove references to C89Alejandro Colomar88-135/+90
C89 is obsolete, and programs should target newer standards. If someone needs information about is, the Standard itself is a better resource. Let's move forward, so readers get the intended notice that C89 is not a useful version of C. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-29scanf.3, sscanf.3, vsscanf.3: Split the page, one for strings and one for FILEsAlejandro Colomar3-665/+756
From these functions, the ones that read from a FILE* are very difficult --if not impossible-- to use correctly. Let's split the page into two, so that we give the impression that sscanf(3) is the first class citizen, and the others are just historic artifacts that are kept for backwards-compatibility reasons. FILE* variants are now in a page which clearly tells the reader to look for other ways to read input. Link: <https://lore.kernel.org/linux-man/633629bd-753c-3097-9896-2491a0b0f1a2@gmail.com/T/> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Zack Weinberg <zack@owlfolio.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-29README: The git repo now covers the full historyAlejandro Colomar1-1/+1
See the 'prehistory' branch in the git repo for pre-1.70 versions. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-28charsets.7: tfixLennart Jablonka1-1/+1
Signed-off-by: Lennart Jablonka <humm@ljabl.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-24string_copying.7: Remove stpecpyx()Alejandro Colomar1-49/+16
And give stpecpy() with the semantics of stpecpyx(). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-24scripts/LinuxManBook/: Add Deri's script for producing the man-pages bookAlejandro Colomar15-0/+23242
Deri is the author of all of this great work! I expect to be able to hook it into the build system, so that we can run `make book-pdf` (or something like that). Cc: Deri James <deri@chuzzlewit.myzen.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-22string_copying.7: tfixAlejandro Colomar1-1/+1
Reported-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-22RELEASE: Fix commandAlejandro Colomar1-1/+3
git-push(1) needs a remote for pushing a tag. Specify korg, my name for the git.kernel.org remote. $ git remote -v | grep korg korg git@gitolite.kernel.org:pub/scm/docs/man-pages/man-pages (fetch) korg git@gitolite.kernel.org:pub/scm/docs/man-pages/man-pages (push) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-22Start of man-pages-NEXT: Move Changes to Changes.oldAlejandro Colomar2-132/+172
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-22lsm: Released 6.02Alejandro Colomar1-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-22Changes: Ready for 6.02man-pages-6.02Alejandro Colomar1-2/+132
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-21strncat.3: EXAMPLES: Check the return of malloc(3)Alejandro Colomar1-0/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-21strcpy.3: EXAMPLES: Check the return of malloc(3)Alejandro Colomar1-0/+5
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20string_copying.7: tfixAlejandro Colomar1-1/+1
Reported-by: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20suffixes.7: Improve table formatG. Branden Robinson1-216/+216
Apparently the original author(s) of this table did not know how to start a table entry in the first column of a tbl(1) table with a dot. (If you try, the *roff formatter will interpret it as a control line, and try to invoke a request or call a macro.) Start every row of the table with the *roff dummy character `\&` instead of leading space. Not only is this more idiomatic, but it recovers some of the line length for content. This patch does not attempt to correct any errors in the table contents, nor bring it up to date from its year 2000 vintage. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20suffixes.7: Drop diagnostic-suppressing hackG. Branden Robinson1-3/+0
The extension of the page length is workaround for <https://savannah.gnu.org/bugs/?63449>, which is a very old groff bug, possibily dating back to groff 1.00 or beyond. It is fixed in groff Git. But waiting for a groff release is not necessary; man-db man(1) nowadays conceals diagnostic messages from the formatter and output drivers. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20strncat.3: Rewrite to be consistent with string_copying.7Alejandro Colomar1-100/+57
Cc: Martin Sebor <msebor@redhat.com> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: Andrew Pinski <pinskia@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20stpncpy.3, strncpy.3: Document in a single pageAlejandro Colomar2-194/+102
Rewrite to be consistent with the new string_copying.7 page. Cc: Martin Sebor <msebor@redhat.com> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: Andrew Pinski <pinskia@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20stpcpy.3, strcpy.3, strcat.3: Document in a single pageAlejandro Colomar3-360/+152
Rewrite to be consistent with the new string_copying.7 page. Cc: Martin Sebor <msebor@redhat.com> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: Andrew Pinski <pinskia@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20stpecpy.3, stpecpyx.3, ustpcpy.3, ustr2stp.3, zustr2stp.3, zustr2ustp.3: Add ↵Alejandro Colomar6-0/+6
new links to string_copying(7) Cc: Martin Sebor <msebor@redhat.com> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: Andrew Pinski <pinskia@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-20string_copying.7: Add page to document all string-copying functionsAlejandro Colomar1-0/+855
This is an opportunity to use consistent language across the documentation for all string-copying functions. It is also easier to show the similarities and differences between all of the functions, so that a reader can use this page to know which function is needed for a given task. Alternative functions not provided by libc have been given in the same page, with reference implementations. Cc: Martin Sebor <msebor@redhat.com> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Cc: Jakub Wilk <jwilk@jwilk.net> Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Cc: Andrew Pinski <pinskia@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-17lint-man.mk: Fix bogus stderr redirectionAlejandro Colomar1-6/+6
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-16utmp.5: STANDARDS: Specify that it's an XSI extensionAlejandro Colomar1-1/+2
Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-15Many pages: Add '\" t' comment where necessaryAlejandro Colomar592-0/+592
Scripted change: $ grep -l -x '^[.]TS$' man*/* | sort -u | xargs sed -i -e "1i'\\\\\" t" Link: <https://lore.kernel.org/linux-man/07a7d4e7-79a6-b2c3-6892-1e39a0679f27@gmail.com/T/#mcf36c8a387fd5ff4f800dc220e3dbdd229b556bd> Reported-by: Jakub Wilk <jwilk@jwilk.net> Cc: Mike Frysinger <vapier@gentoo.org> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-15INSTALL, Makefile, cmd.mk, lint-man.mk: Lint about '\" t' comment for tbl(1)Alejandro Colomar4-1/+29
This is to make sure that we have correct \" t comments in the pages, which are necessary for the Debian package checker: On 8/19/22 22:21, Jakub Wilk wrote: > * Michael Kerrisk <mtk.manpages@gmail.com>, 2020-07-24 12:13: >> For 15 years or at least, I've not paid any attention to adding the >> 't' comments when I added tables to pages, and I do recall anyone >> reporting ill effects. So, I'm inclined to apply Mike's patch, but >> will hold off a moment, in case there's other feedback. > > I'm a bit late, but... > > Lintian, the Debian package checker, sets the MANROFFSEQ environment > variable to empty string as a speed optimization. This turns off > loading preprocessors that weren't explicitly declared in the source. > The lack of '\" comments can cause false positives (and maybe also > false negatives?) in Lintian. > > The use of $MANROFFSEQ for Lintian was proposed here: > https://bugs.debian.org/677874 > > Beware that the man(1) man page does not correctly explain what > $MANROFFSEQ does: <https://bugs.debian.org/971009> Also update the dependencies list, since now we also need head(1) and tail(1) for linting man(7) source. Link: <https://lore.kernel.org/linux-man/07a7d4e7-79a6-b2c3-6892-1e39a0679f27@gmail.com/T/#mcf36c8a387fd5ff4f800dc220e3dbdd229b556bd> Reported-by: Jakub Wilk <jwilk@jwilk.net> Cc: Mike Frysinger <vapier@gentoo.org> Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-15man-pages.7: tfixEric Biggers1-4/+4
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-15ioctl_userfaultfd.2: tfixEric Biggers1-1/+1
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-15INSTALL: tfixEric Biggers1-1/+1
Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-15utimensat.2: tfixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-14copy_file_range.2: wfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-14copy_file_range.2: Fix wrong kernel version informationAmir Goldstein1-6/+11
commit d7ba612d0 ("copy_file_range.2: Update cross-filesystem support for 5.12") prematurely documented kernel 5.12 as the version that changes the cross-fs copy_file_range() behavior, but that behavior change was only merged in kernel version 5.19. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-12scanf.3: Do not mention the ERANGE errorIan Abbott1-7/+0
The `scanf()` function does not intentionally set `errno` to `ERANGE`. That is just a side effect of the code that it uses to perform conversions. It also does not work as reliably as indicated in the 'man' page when the target integer type is narrower than `long`. Typically (at least in glibc) for target integer types narrower than `long`, the number has to exceed the range of `long` (for signed conversions) or `unsigned long` (for unsigned conversions) for `errno` to be set to `ERANGE`. Documenting `ERANGE` in the ERRORS section kind of implies that `scanf()` should return `EOF` when an integer overflow is encountered, which it doesn't (and doing so would violate the C standard). Just remove any mention of the `ERANGE` error to avoid confusion. Fixes: 646af540e467 ("Add an ERRORS section documenting at least some of the errors that may occur for scanf().") Link: <https://lore.kernel.org/linux-man/5af4f708-337f-fddf-9a2d-e0e4602d3a72@mev.co.uk/T/#m900a1b1741afefab008a69e6b76919cd94aa81ef> Cc: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Zack Weinberg <zack@owlfolio.org> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-12scanf.3: Deprecate unsafe conversion specifiersAlejandro Colomar1-0/+11
Use of numeric conversion specifiers can produce Undefined Behvaior under conditions that the program doesn't control; therefore, there's no way to use them safely. Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Zack Weinberg <zack@owlfolio.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-12core.5: Clarify that RLIMIT_CORE is ignored when piping.Alejandro Colomar1-0/+3
Reported-by: Luca Versari <veluca93@gmail.com> Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=216648> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-12intro.3: Document subsections of man3Alejandro Colomar1-0/+31
Cowritten-by: "G. Branden Robinson" <g.branden.robinson@gmail.com> Cc: Ingo Schwarze <schwarze@openbsd.org> Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-11shm_open.3: tfixAlejandro Colomar1-2/+2
Reported-by: 1092615079 <1092615079@qq.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-11socket.7: Be explicit that accept(2) respects SO_*TIMEOAlejandro Colomar1-0/+1
See the previous commit. Reported-by: Luis Javier Merino <ninjalj@gmail.com> Cc: Tycho Andersen <tycho@tycho.pizza> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-09socket.7: be explicit that connect(2) respects SO_*TIMEOTycho Andersen1-0/+1
Our group recently had some confusion around this. Although f327722042df ("socket.7: Explain effect of SO_SNDTIMEO for connect()") adds a mention of connect(2), the wording around "Timeouts only have effect for system calls that perform socket I/O" is slightly confusing: is connect(2) I/O?. Let's just add connect(2) to the list of things that time out explicitly to avoid any confusion. Test program for grins: #include <stdio.h> #include <sys/socket.h> #include <netinet/ip.h> #include <arpa/inet.h> int main(void) { struct sockaddr_in servaddr = { /* tycho.pizza */ .sin_addr.s_addr = inet_addr("192.241.255.151"), .sin_port = htons(443), .sin_family = AF_INET, }; int fd; struct timeval timeout = { .tv_sec = 0, .tv_usec = 100, }; fd = socket(AF_INET, SOCK_STREAM, 0); if (fd < 0) { perror("socket"); return 1; } if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)) < 0) { perror("setsockopt"); return 1; } if (connect(fd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) { perror("connect"); return 1; } printf("connect successful\n"); return 0; } $ ./so_sndtimeo connect: Operation now in progress Signed-off-by: Tycho Andersen <tycho@tycho.pizza> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-06stpncpy.3, strncpy.3: wfixAlejandro Colomar2-4/+4
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-06strncat.3: Overrunning the dest buffer is not that badAlejandro Colomar1-117/+28
With the right function call, that is, one that always copies the same amount of bytes, and is so simple that can be inlined, the behavior will be consistent enough to be warned by the compiler in most cases of overrun, and crash quite consistently in the remaining. Prefer simplicity over correctness, so suggest the simpler ustr2stp(). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-06string.3, strncat.3: Undeprecate strncat(3)Alejandro Colomar2-36/+198
After some investigation, I found a case where this function is useful: Concatenating an unterminated string into a string. It's not an ideal API for that, but there's no other API that does it. The closest thing, and something that some projects use instead of strncat(3), is calling mempcpy(3) directly. However mempcpy(3) isn't ideal either (it's faster; just that). It even requires a multiline pattern to use correctly, which is a source of bugs. So, suggest using a custom alternative that needs to be defined by the programmer, which handles all the subtle details much better than any of the conventional functions: ustr2stpe(). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-06string.3, strncat.3: Fix typo in prototype of strncat(3)Alejandro Colomar2-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-06string.3: strncpy(3), strncat(3): Obsolete, and fixAlejandro Colomar1-28/+29
The prototype for strncat(3) was wrong. Fix it. Mark the functions as obsolete. Fix the descriptions, to remove misleading text. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-06strncat.3: tfixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strncat.3: BUGS: TruncationAlejandro Colomar1-0/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strcat.3, strncat.3: RIP strncat(3)Alejandro Colomar2-72/+95
Never use this function. Really. Cc: <pkg-shadow-devel@alioth-lists.debian.net> Cc: <libc-alpha@sourceware.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strcat.3: SYNOPSIS: Fix the size of 'dest'Alejandro Colomar1-3/+2
I had a mistake when adding VLA syntax to this prototype. From this fixed prototype, it's visible how broken the design for this function is. Next move is to kill this function. Cc: <libc-alpha@sourceware.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05stpncpy.3: Clarify what this function is forAlejandro Colomar1-34/+48
Use concise wording to make the points more direct. This function is rarely used for its only valid purpose. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05filesystems.5: Don't refer to dead software; use a more generic termAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Reported-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strncpy.3: Rename CAVEATS to BUGSAlejandro Colomar1-2/+2
Those are not caveats, but actual bugs. This function was misdesigned. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strncpy.3: wfixAlejandro Colomar1-1/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strncpy.3: NAME: Clarify what this function isAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strncpy.3: SEE ALSO: Remove some referencesAlejandro Colomar1-3/+0
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-05strncpy.3: Deprecate strncpy(3) in favor of stpncpy(3)Alejandro Colomar1-6/+15
It is equivalent, but reports truncation. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04strncpy.3: Move description of valid use upAlejandro Colomar1-8/+9
To make it more visible; and refer CAVEATS to still discourage its use. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04strncpy.3: CAVEATS: It can't detect truncationAlejandro Colomar1-0/+7
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04strncpy.3: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04strncpy.3: Fix TH, and add myself to copyrightAlejandro Colomar1-2/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04strcpy.3, strncpy.3: Split the page and document them separatelyAlejandro Colomar2-118/+122
strncpy(3) is completely unrelated to strcpy(3). Rewrite its documentation to be more explicit about this. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04path_resolution.7: ffixAlejandro Colomar1-1/+3
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04credentials.7: tfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04credentials.7: tfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04console_codes.4: tfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04cpow.3: tfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04connect.2: ffixAlejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04connect.2: tfixAlejandro Colomar1-1/+0
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04wcsspn.3: NAME: Fix summary-descriptionAlejandro Colomar1-2/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04wavelan.4: tfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04uts_namespaces.7: wfixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04user_namespaces.7: Add missing wordAlejandro Colomar1-2/+2
Cc: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04user_namespaces.7: ffixAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2022-12-04user_namespaces.7: wfixAlejandro Colomar1-2/+2
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Cc: Mario Blättermann <mario.blaettermann@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>