summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Changes: Ready for 6.02man-pages-6.02Alejandro Colomar2022-12-22-2/+132
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncat.3: EXAMPLES: Check the return of malloc(3)Alejandro Colomar2022-12-21-0/+3
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strcpy.3: EXAMPLES: Check the return of malloc(3)Alejandro Colomar2022-12-21-0/+5
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* string_copying.7: tfixAlejandro Colomar2022-12-20-1/+1
| | | | | Reported-by: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* suffixes.7: Improve table formatG. Branden Robinson2022-12-20-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>
* suffixes.7: Drop diagnostic-suppressing hackG. Branden Robinson2022-12-20-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>
* strncat.3: Rewrite to be consistent with string_copying.7Alejandro Colomar2022-12-20-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>
* stpncpy.3, strncpy.3: Document in a single pageAlejandro Colomar2022-12-20-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>
* stpcpy.3, strcpy.3, strcat.3: Document in a single pageAlejandro Colomar2022-12-20-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>
* stpecpy.3, stpecpyx.3, ustpcpy.3, ustr2stp.3, zustr2stp.3, zustr2ustp.3: Add ↵Alejandro Colomar2022-12-20-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>
* string_copying.7: Add page to document all string-copying functionsAlejandro Colomar2022-12-20-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>
* lint-man.mk: Fix bogus stderr redirectionAlejandro Colomar2022-12-17-6/+6
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* utmp.5: STANDARDS: Specify that it's an XSI extensionAlejandro Colomar2022-12-16-1/+2
| | | | | | Cc: Serge Hallyn <serge@hallyn.com> Cc: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Many pages: Add '\" t' comment where necessaryAlejandro Colomar2022-12-15-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>
* INSTALL, Makefile, cmd.mk, lint-man.mk: Lint about '\" t' comment for tbl(1)Alejandro Colomar2022-12-15-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>
* man-pages.7: tfixEric Biggers2022-12-15-4/+4
| | | | | Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* ioctl_userfaultfd.2: tfixEric Biggers2022-12-15-1/+1
| | | | | Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* INSTALL: tfixEric Biggers2022-12-15-1/+1
| | | | | Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* utimensat.2: tfixJakub Wilk2022-12-15-1/+1
| | | | | Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* copy_file_range.2: wfixAlejandro Colomar2022-12-14-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* copy_file_range.2: Fix wrong kernel version informationAmir Goldstein2022-12-14-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>
* scanf.3: Do not mention the ERANGE errorIan Abbott2022-12-12-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>
* scanf.3: Deprecate unsafe conversion specifiersAlejandro Colomar2022-12-12-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>
* core.5: Clarify that RLIMIT_CORE is ignored when piping.Alejandro Colomar2022-12-12-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>
* intro.3: Document subsections of man3Alejandro Colomar2022-12-12-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>
* shm_open.3: tfixAlejandro Colomar2022-12-11-2/+2
| | | | | Reported-by: 1092615079 <1092615079@qq.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* socket.7: Be explicit that accept(2) respects SO_*TIMEOAlejandro Colomar2022-12-11-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>
* socket.7: be explicit that connect(2) respects SO_*TIMEOTycho Andersen2022-12-09-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>
* stpncpy.3, strncpy.3: wfixAlejandro Colomar2022-12-06-4/+4
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncat.3: Overrunning the dest buffer is not that badAlejandro Colomar2022-12-06-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>
* string.3, strncat.3: Undeprecate strncat(3)Alejandro Colomar2022-12-06-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>
* string.3, strncat.3: Fix typo in prototype of strncat(3)Alejandro Colomar2022-12-06-2/+2
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* string.3: strncpy(3), strncat(3): Obsolete, and fixAlejandro Colomar2022-12-06-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>
* strncat.3: tfixAlejandro Colomar2022-12-06-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncat.3: BUGS: TruncationAlejandro Colomar2022-12-05-0/+7
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strcat.3, strncat.3: RIP strncat(3)Alejandro Colomar2022-12-05-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>
* strcat.3: SYNOPSIS: Fix the size of 'dest'Alejandro Colomar2022-12-05-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>
* stpncpy.3: Clarify what this function is forAlejandro Colomar2022-12-05-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>
* filesystems.5: Don't refer to dead software; use a more generic termAlejandro Colomar2022-12-05-1/+1
| | | | | | Reported-by: Helge Kreutzmann <debian@helgefjell.de> Reported-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: Rename CAVEATS to BUGSAlejandro Colomar2022-12-05-2/+2
| | | | | | Those are not caveats, but actual bugs. This function was misdesigned. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: wfixAlejandro Colomar2022-12-05-1/+0
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: NAME: Clarify what this function isAlejandro Colomar2022-12-05-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: SEE ALSO: Remove some referencesAlejandro Colomar2022-12-05-3/+0
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: Deprecate strncpy(3) in favor of stpncpy(3)Alejandro Colomar2022-12-05-6/+15
| | | | | | It is equivalent, but reports truncation. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: Move description of valid use upAlejandro Colomar2022-12-04-8/+9
| | | | | | To make it more visible; and refer CAVEATS to still discourage its use. Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: CAVEATS: It can't detect truncationAlejandro Colomar2022-12-04-0/+7
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: ffixAlejandro Colomar2022-12-04-1/+1
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strncpy.3: Fix TH, and add myself to copyrightAlejandro Colomar2022-12-04-2/+3
| | | | Signed-off-by: Alejandro Colomar <alx@kernel.org>
* strcpy.3, strncpy.3: Split the page and document them separatelyAlejandro Colomar2022-12-04-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>
* path_resolution.7: ffixAlejandro Colomar2022-12-04-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>