aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2023-03-30man*/, man-pages.7: VERSIONS, STANDARDS, HISTORY: Reorganize sectionsAlejandro Colomar883-5719/+6875
- Add a new HISTORY section that covers the history of an API, both regarding implementations and regarding old standards. This was previously covered in VERSIONS, and in some cases in STANDARDS. - Repurpose VERSIONS to cover differing implementations in _current_ systems. - STANDARDS is reduced to only cover current versions of standards. That basically means only C11 (C99 has been superseeded by C11; C17 is just a bugfix of C11, so not really a new version), and POSIX.1-2008 (*-2001 was superseeded by *-2008; *-2017 was just a bugfix for *-2008). The section also mentions for example 'Linux', 'GNU' or 'BSD' when a non-standard API is Linux- or GNU-only or if it's (de-facto) standard in the BSDs. - In some cases content that should go into one of these sections was in NOTES. Move it from there to where it corresponds. - In the SYNOPSIS, I added [[deprecated]] in some functions that I found are deprecated by the relevant standards. - A few other related changes... Cc: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-21man*/: Replace links to <sources.redhat.com>Yedidyah Bar David32-43/+43
<sources.redhat.com/bugzilla> seems broken right now. Apparently it was replaced, quite a long time ago --based on what I can find on the net-- with <www.sourceware.org/bugzilla>, which does work. This patch was created with: $ find man* -type f \ | xargs grep -l 'sources.redhat.com/bugzilla' \ | xargs sed -i 's;http://sources.redhat.com/bugzilla/;https://www.sourceware.org/bugzilla/;g' Verified with: $ git diff | sed -n 's;^+.*\(https://www.sourceware.org/bugzilla/show_bug.cgi?id=[0-9]*\).*;\1;p' > URLs $ mkdir test $ cd test $ wget -i ../URLs Signed-off-by: Yedidyah Bar David <didi@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-19CONTRIBUTING: Recommend make(1)'s -W, rather than actually touching the fileAlejandro Colomar1-6/+6
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-18timer_settime.2: SYNOPSIS: Put timer_gettime() firstAlejandro Colomar1-1/+1
This matches the order in getitimer(2), and so makes it easier to compare them. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-18arc4random.3: Simplify STANDARDS; add HISTORYAlejandro Colomar1-1/+8
Data copied from libbsd's page. Reported-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-18bind.2: NOTES: Remove sectionAlejandro Colomar1-5/+0
'socklen_t' now has its own manual page. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-18man*/: tfixTom Schwindl3-3/+3
Signed-off-by: Tom Schwindl <schwindl@posteo.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17man2/, man3/, man-pages.7: Move VERSIONS next to STANDARDSAlejandro Colomar165-636/+636
VERSIONS and STANDARDS are closely related (and often the distinction is not so clear). Now that we're going to add another section, HISTORY, that is related to both, it makes sense to have the three together. As a curiosity, the list in man-pages(7) that detailed what each section should contain had them by accident(?) in the order that we're moving to, instead of the order that was used elsewhere. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17feature_test_macros.7: STANDARDS: Some ftm are specific to glibc, not LinuxAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17inode.7: STANDARDS: Remove bogus recommendationAlejandro Colomar1-12/+0
'blkcnt_t' is defined in <sys/types.h>, per POSIX.1-2001, as blkcnt_t(3type) documents. Also, it doesn't need any ftm(7) to be defined, AFAICS: $ cat blkcnt_t.c #include <sys/types.h> int main(void) { blkcnt_t x; return x = 0; } $ cc -Wall -Wextra blkcnt_t.c $ Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17capabilities.7: ffixAlejandro Colomar1-1/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17hier.7: ffixAlejandro Colomar1-2/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17ip.7: Fix IP_MULTICAST_ALL descriptionChristoph Lameter1-4/+1
INADDR_ANY has nothing to do with the IP_MULTICAST_ALL option. It does not matter if the interface is bound to all interfaces or a particular interface for the functionality of IP_MULTICAST_ALL. Multicast datagrams are addressed to a multicast IP address and will enter the network stack via a particular interface. The application can choose from which interface it will receive multicast data by binding the socket to an IP address. It can then use the IP_MULTICAST_ALL option to restrict the multicast groups that the IP stack will deliver via the socket. Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17suffixes.7: ffixAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-17suffixes.7: Add .shtmlAlejandro Colomar1-0/+1
Link: <https://stackoverflow.com/questions/519619/what-is-the-purpose-and-uniqueness-shtml> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-15arc4random.3, man-pages.7: ffixAlejandro Colomar2-2/+2
Reported-by: Jakub Wilk <jwilk@jwilk.net> Cc: Tom Schwindl <schwindl@posteo.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-13standards.7: ffixOskari Pirhonen1-1/+1
Fix indentation of the LFS entry. Signed-off-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-13Revert "Many pages: Remove references to C89"Alejandro Colomar88-89/+134
This reverts commit 72b349dd8c209d7375d4d4f76e2315943d654ee9. This removal caused inconveniences to some programmers. We've agreed to keep the information about C89, since there's an easy way to keep it correct by checking against a plain-text copy of the standard itself: $ stdc89() { grep "[[:alpha:]] \**\b$1([[:alnum:]*,. ]*);" /path/to/c89-draft.txt; } $ stdc89 printf int printf(const char *format, ...); int printf(const char *format, ...); We will also do a split of the information in STANDARDS, since now it's a mix of what a proper STANDARDS section would be plus a HISTORY section commonly-found in other manual pages. C89 will go into HISTORY. Link: <https://lore.kernel.org/linux-man/b73a9636-1a17-36f3-3718-d9ca3b9293ed@gmail.com/T/> Link: <https://port70.net/~nsz/c/c89/c89-draft.txt> Reported-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com> Reported-by: Matt Jolly <Matt.Jolly@footclan.ninja> Cc: Brian Inglis <Brian.Inglis@Shaw.ca> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12session-keyring.7: ffixAlejandro Colomar1-1/+3
Add a man-page reference at the first occurence of PAM. Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12charsets.7: „German“ quotations are not old-style, but rather standardAlejandro Colomar1-1/+1
Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12man*/: Fix ISO -> ISO/IEC where appropriateAlejandro Colomar5-13/+13
Link: <https://www.iso.org> Reported-by: Helge Kreutzmann <debian@helgefjell.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12.gitignore, *.mk, README, RELEASE: Make $builddir a hidden dirAlejandro Colomar5-6/+6
Use <.tmp> instead of <tmp>. This makes it easier to ignore it in things like recursive searches. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12man7/: ffixAlejandro Colomar2-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12*.mk: Remove unnecessary '.' after directory names (but keep the '/')Alejandro Colomar9-52/+52
I used it for some reason I don't remember, probably because I did something wrong, and didn't know how to do it right. I've tried now without it, and it's working, so let's just remove it. While we don't want trailing slashes in directory variables, we want them in targets, so we can distinguish directory targets. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12boot.7: ffixAlejandro Colomar1-1/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12boot.7: wfix + ffixAlejandro Colomar1-12/+15
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-12man7/: ffixAlejandro Colomar2-3/+3
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11CONTRIBUTING: Use make(1)'s '-t' to avoid linting everythingAlejandro Colomar1-5/+3
Suggested-by: Paul Smith <psmith@gnu.org> Cc: Dmitry Goncharov <dgoncharov@users.sf.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11*.mk: Prefix recipes that create directories with '+'Alejandro Colomar3-7/+7
This will allow running using make(1)'s '-t'. Reported-by: Paul Smith <psmith@gnu.org> Cc: Dmitry Goncharov <dgoncharov@users.sf.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11ldconfig.8: tfixSamanta Navarro1-1/+1
Typo found with codespell. Signed-off-by: Samanta Navarro <ferivoz@riseup.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11INSTALL, Makefile: Document available variables.Alejandro Colomar2-17/+93
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11build-src.mk, cmd.mk: Use pkgconf(1) instead of pkg-config(1)Alejandro Colomar2-6/+6
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11build-html.mk: Don't ignore $(htmlext)Alejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-11standards.7: ffixJakub Wilk1-1/+1
Signed-off-by: Jakub Wilk <jwilk@jwilk.net> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-10lint-man.mk: lint-man-groff-eqn: Fix error detectionAlejandro Colomar1-1/+1
eqn(1) could theoretically write _only_ newlines to standard error. That's unlikely, but I'm still worried that someone (even me) might copy this trick around, and use it in situations where that might actually happen. Let's be more precise, and fail when there's literally anything on standard error. Reported-by: Ralph Corderoy <ralph@inputplus.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-10lint-man.mk: lint-man-groff-eqn: Fail if eqn(1) writes to stderrAlejandro Colomar1-1/+2
eqn(1) still exits with 0 after reporting errors. Let's grep stderr, and if there's anything, fail. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-10Makefile, lint-man.mk: Delete files on errorAlejandro Colomar1-0/+1
Without .DELETE_ON_ERROR, if a command fails, but has written to a file (e.g., with '>'), the file will still exist, and successive make(1) invocations will think it previously succeeded. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-10Makefile, lint-man.mk: lint-man-groff-preconv: Add preconv(1) to the ↵Alejandro Colomar2-2/+17
groff(1) pipeline Without it, some pages fail in 'lint-man-groff-eqn', and would should weird characters. Suggested-by: Ralph Corderoy <ralph@inputplus.co.uk> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-10posix_memalign.3: SYNOPSIS: Mark functions as [[deprecated]]Alejandro Colomar1-3/+3
These functions are declared as obsolete in the same page. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09Makefile, lint-man.mk: lint-man-groff-col, lint-man-groff-grep: Split ↵Alejandro Colomar2-4/+18
targets from lint-man-groff Allow running col(1) and grep(1) separately, which allows more granular testing, and also inspecting the output of col(1), which can be useful for debugging the pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09Makefile, lint-man.mk: lint-man-groff-grotty: Split target from lint-man-groffAlejandro Colomar2-4/+13
Allow running grotty(1) separately, which allows more granular testing, and also inspecting the output of grotty(1), which can be useful for debugging the pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09Makefile, lint-man.mk: lint-man-groff-troff: Split target from lint-man-groffAlejandro Colomar2-5/+14
Allow running troff(1) separately, which allows more granular testing, and also inspecting the output of troff(1), which can be useful for debugging the pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09Makefile, lint-man.mk: lint-man-groff-eqn: Split target from lint-man-groffAlejandro Colomar2-3/+12
Allow running eqn(1) separately, which allows more granular testing, and also inspecting the output of eqn(1), which can be useful for debugging the pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09Makefile, lint-man.mk: lint-man-groff-tbl: Split target from lint-man-groffAlejandro Colomar2-4/+14
Allow running tbl(1) separately, which has several benefits: - More granular testing. - Allows inspecting the output of tbl(1), which can be useful for debugging the pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09lint-man.mk: make-lint-tbl: ffixAlejandro Colomar1-1/+1
Print 'LINT (tbl comment)' to not confuse users to think that we run tbl(1) at all. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09lint-man.mk: lint-man-mandoc: Silence warnings about '\\'Alejandro Colomar1-0/+1
There are false positives in tzdb pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09lint-man.mk: lint-man-mandoc: Silence warnings about missing dateAlejandro Colomar1-0/+1
tzdb pages have no date it them. Don't warn about that. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09tzfile.5, tzselect.8, zdump.8, zic.8: sync pages from tzdbAlejandro Colomar4-107/+216
Cc: Paul Eggert <eggert@cs.ucla.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09suffixes.7: Add .jsx and .tsxAlejandro Colomar1-0/+2
Cc: Timo Stark <t.stark@nginx.com> Cc: Andrew Clayton <andrew@digital-domain.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09CONTRIBUTING: tfixTom Schwindl1-1/+1
Signed-off-by: Tom Schwindl <schwindl@posteo.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09man*/: ffixTom Schwindl2-5/+5
Signed-off-by: Tom Schwindl <schwindl@posteo.de> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09INSTALL, cmd.mk, install-man.mk: Support installing compressed pagesAlejandro Colomar3-36/+55
Distributions usually install compressed (.gz) pages to reduce space. Let's support this in our build system, as a command-line variable "Z", which is empty by default, but can be set to a file extension to append to the page names (and the appropriate compression program will be used). For now, the only compression supported is ".gz". Example: $ make install Z=.gz This can be combined with LINK_PAGES, to produce compressed pages and use symbolic links for the link pages: $ make install Z=.gz LINK_PAGES=symlink Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-09cmd.mk, install-man.mk: Allow installing link pages as symlinksAlejandro Colomar3-0/+18
We keep them as .so "includes" in our source code, but if some distribution wants to have them as symlinks in their filesystem, make it easy for them to install as such, by specifying 'LINK_PAGES=symlink'. Example: $ make install LINK_PAGES=symlink Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08CONTRIBUTING: Fix typo, there is one active maintainerRodrigo Campos1-1/+1
On commit "CONTRIBUTING, README, lsm: Remove mtk as maintainer" (06e72cb1) we changed to mail only one maintainer, but the doc still says "both maintainers". When submitting a patch, I was confused by that fact and thought Michael address was missing. But after checking, it seems we just need to send it to Alejandro, so clarify the text to match that. Signed-off-by: Rodrigo Campos <rodrigo@sdfg.com.ar> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08tzfile.5, tzselect.8: sync from tzdb upstreamPaul Eggert2-90/+237
This makes tzfile.5 and tzselect.8 a copy of the tzdb develoment version (commit 12b48faf10c265ee3ea1aad8cdb5c8239eea65a0), except that man-pages boilerplate surrounds the copyright notice, and the .TH line uses man-pages format. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08string_copying.7: Modify implementation of stpecpy()Alejandro Colomar1-3/+2
- Don't crash on invalid input. That should be done in a wrapper, if wanted. - Accept NULL as input, since that allows chaining with stpeprintf(). Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08man3/: srcfix (\" t comments)Alejandro Colomar2-1/+1
Add missing or remove redundant \" t comments (for tbl(1)). Reported-by: mandoc(1) (make lint-man-mandoc) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08string_copying.7: srcfix (unmatched RE)Alejandro Colomar1-1/+0
Reported-by: mandoc(1) (make lint-man-mandoc) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08man*/: srcfix (IP)Alejandro Colomar3-7/+4
Two consecutive IPs without text don't make sense, since they are paragraph separators. The reason we needed it was that PD 0 was misplaced. This extra IP was also causing another problem: we needed to specify again the indentation of the outer list. Reported-by: mandoc(1) (make lint-man-mandoc) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08man*/: ffix (semantic newlines; commas)Alejandro Colomar15-57/+79
Reported-by: mandoc(1) (make lint-man-mandoc) Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-08Makefile: help: Document lint-c-cppcheckAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-06udp.7: Fix man page reference (section number)Alejandro Colomar1-2/+2
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-06udp.7: add UDP_GROWillem de Bruijn1-0/+14
UDP_GRO was added in commit e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.") $ git describe --contains e20cf8d3f1f7 linux/v5.0-rc1~129^2~379^2~8 Kernel source has example code in tools/testing/selftests/net/udpgro* Per https://www.kernel.org/doc/man-pages/patches.html, "Describe how you obtained the information in your patch": I reviewed the relevant UDP_GRO patches. Signed-off-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Cc: <pabeni@redhat.com> Cc: <netdev@vger.kernel.org> [ alx: srcfix ] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-06udp.7: add UDP_SEGMENTWillem de Bruijn1-0/+29
UDP_SEGMENT was added in commit bec1f6f69736 ("udp: generate gso with UDP_SEGMENT") $ git describe --contains bec1f6f69736 linux/v4.18-rc1~114^2~377^2~8 Kernel source has example code in tools/testing/selftests/net/udpgso* Per https://www.kernel.org/doc/man-pages/patches.html, "Describe how you obtained the information in your patch": I am the author of the above commit and follow-ons. Signed-off-by: Willem de Bruijn <willemb@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Cc: <pabeni@redhat.com> Cc: <netdev@vger.kernel.org> [ alx: srcfix + use interval notation ] Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-05recv.2: Mention SOCK_SEQPACKET in MSG_TRUNC flag descriptionVladislav Ivanishin1-1/+2
unix_seqpacket_recvmsg() calls unix_dgram_recvmsg() which handles MSG_TRUNC. This has been the case since the handling was added in 9f6f9af7694ede6314bed281eec74d588ba9474f; see net/unix/af_unix.c: static int unix_seqpacket_recvmsg([...]) { [...] return unix_dgram_recvmsg(iocb, sock, msg, size, flags); } The sequential-packet socket type seems to have been left out from the description by an oversight. Signed-off-by: Vladislav Ivanishin <vlad@ispras.ru> Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-05install-man.mk: Update copyright yearAlejandro Colomar1-1/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-04install-man.mk, src.mk: Respect user-specified man dirsAlejandro Colomar2-31/+72
If a user specifies man3dir=/.../man3c, respect it and install there. Currently, we were transforming link pages to use that dir name, but the install location itself was still being calculated, which generated inconsistently installed pages. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-04install-man.mk: Fix link pages when installing in different mandirsAlejandro Colomar1-0/+14
If downstream wants to put pages in different places (e.g., Debian uses man2/ and man3/, rather than man2type/ and man3const/, man3head/, and man3type/), make it easy for them. Link pages need to be fixed according to the dirname where the pages are actually being installed. Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-03-04install-man.mk: Add missing variable $man3constextAlejandro Colomar1-0/+1
Signed-off-by: Alejandro Colomar <alx@kernel.org>
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>