]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
8 months agoman/: Terminology consistency reforms (n, size, length)
Alejandro Colomar [Sun, 17 Nov 2024 17:47:53 +0000 (18:47 +0100)] 
man/: Terminology consistency reforms (n, size, length)

Use 'length' for the lenght of a string.
Use 'n' for the number of elements.
Use 'size' for the number of bytes.  (And in wide-character string
functions, 'size' also refers to the number of wide characters.)

The change is quite large, and I might have made some mistakes.
But overall, this should improve consistency in use of these terms.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agogetdents.2: ffix
Alejandro Colomar [Sun, 17 Nov 2024 15:24:05 +0000 (16:24 +0100)] 
getdents.2: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agowcwidth.3: Rename function parameter
Alejandro Colomar [Sun, 17 Nov 2024 15:13:18 +0000 (16:13 +0100)] 
wcwidth.3: Rename function parameter

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agofmod.3: ffix
Alejandro Colomar [Sun, 17 Nov 2024 15:11:13 +0000 (16:11 +0100)] 
fmod.3: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoremquo.3: pfix
Alejandro Colomar [Sun, 17 Nov 2024 15:09:13 +0000 (16:09 +0100)] 
remquo.3: pfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agotime.1: ffix
Alejandro Colomar [Sun, 17 Nov 2024 12:14:54 +0000 (13:14 +0100)] 
time.1: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agosscanf.3: wfix
Alejandro Colomar [Sun, 17 Nov 2024 12:08:48 +0000 (13:08 +0100)] 
sscanf.3: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoattributes.7: wfix
Alejandro Colomar [Sun, 17 Nov 2024 12:07:22 +0000 (13:07 +0100)] 
attributes.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agosyscalls.2: tfix
Alejandro Colomar [Sun, 17 Nov 2024 12:05:50 +0000 (13:05 +0100)] 
syscalls.2: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agotime.1: ffix
Alejandro Colomar [Sun, 17 Nov 2024 11:59:40 +0000 (12:59 +0100)] 
time.1: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agosscanf.3: tfix
Alejandro Colomar [Sun, 17 Nov 2024 11:52:26 +0000 (12:52 +0100)] 
sscanf.3: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agosched_get_priority_max.2: pfix
Alejandro Colomar [Sun, 17 Nov 2024 11:50:59 +0000 (12:50 +0100)] 
sched_get_priority_max.2: pfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agosscanf.3: ffix
Alejandro Colomar [Sun, 17 Nov 2024 11:49:01 +0000 (12:49 +0100)] 
sscanf.3: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoman/: tfix
Alejandro Colomar [Sun, 17 Nov 2024 11:45:14 +0000 (12:45 +0100)] 
man/: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoscanf.3: pfix
Alejandro Colomar [Sun, 17 Nov 2024 11:34:00 +0000 (12:34 +0100)] 
scanf.3: pfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoproc_pid_fd.5: ffix
Alejandro Colomar [Sun, 17 Nov 2024 11:23:48 +0000 (12:23 +0100)] 
proc_pid_fd.5: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agogetrpcent_r.3: tfix
Alejandro Colomar [Sun, 17 Nov 2024 11:04:04 +0000 (12:04 +0100)] 
getrpcent_r.3: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agomemusage.1: ffix
Alejandro Colomar [Sun, 17 Nov 2024 11:02:24 +0000 (12:02 +0100)] 
memusage.1: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agolog1p.3: pfix
Alejandro Colomar [Sun, 17 Nov 2024 11:01:06 +0000 (12:01 +0100)] 
log1p.3: pfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agolistmount.2: Fix off-by-one bug in description about continuing the iteration
Jeff Layton [Wed, 13 Nov 2024 14:49:02 +0000 (09:49 -0500)] 
listmount.2: Fix off-by-one bug in description about continuing the iteration

The "+1" is wrong, since the kernel already increments the last_id.

Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Message-ID: <20241113-main-v1-1-a6b738d56e55@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoprintf.3: wfix
Ken Pizzini [Fri, 15 Nov 2024 22:11:04 +0000 (14:11 -0800)] 
printf.3: wfix

Improve description of %a format.

The description of the %a/%A specifiers in the printf(3) man page
could stand some improvement.  In particular, it is not clear from the
current document what base is used for the "p±d" part of the format.

It can be inferred from the nature of %a that the base should be a power
of two.  And it can be further inferred from the nature of hexadecimal
floating-point literals in C (as specified by C99 and later) that the
base must exactly be the number two, but it would be helpful for the
printf(3) man page to state this explicitly.  My first expectation when
reading the man page was that the exponent would be taken in base 16;
after experimentation my second thought was that it would be base
FLT_RADIX (which is 2 on IEEE 754 floating-point systems, but 16 on
S/390).  Only by going back to the standard [1] could I determine that
the exponent in p-notation must always be taken from a base of 2.

Link: [1] POSIX.1-2024 <https://pubs.opengroup.org/onlinepubs/9799919799/functions/printf.html>
Cc: Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Ken Pizzini <ken@gnu.org>
Message-ID: <b932f13642502e063ef139d57b8f3c496023bf4a.1731707666.git.ken@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agoprintf.3: wfix
Ken Pizzini [Fri, 15 Nov 2024 08:23:05 +0000 (00:23 -0800)] 
printf.3: wfix

Improve terminology in %a description

The term "decimal point" does not technically apply when using bases
other than 10; the more generic term is "radix point".  Update the
description of the a/A conversion specifier (i.e., for hexadecimal
floating point output) in printf(3) to use this terminology.

I do note that POSIX.1-2024 [1] does use the term "decimal-point
character" here, but I still maintain that using "radix point" is a
better term for that object in the %a description.  (Confusingly, POSIX
does refer to "radix character" in the descriptions of %f and %e, where
reference to "decimal" instead of "radix" would actually make sense.)

Link: [1] <https://pubs.opengroup.org/onlinepubs/9799919799/functions/printf.html>
Signed-off-by: Ken Pizzini <ken@gnu.org>
Message-ID: <db91cc6f-93cc-4e99-806c-7a8b86232848@vagg4fs7.msa.explicate.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agolsearch.3: Dereference 'nmemb' pointer
Alejandro Colomar [Thu, 14 Nov 2024 22:46:26 +0000 (23:46 +0100)] 
lsearch.3: Dereference 'nmemb' pointer

nmemb is a pointer, so it needs to be dereferenced to calculate the size
of the array.

Reported-by: Martin Uecker <uecker@tugraz.at>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
8 months agopthread_cond_init.3: tfix
Alejandro Colomar [Wed, 13 Nov 2024 11:10:04 +0000 (12:10 +0100)] 
pthread_cond_init.3: tfix

Reported-by: Antti Antinoja <antti@c1.fi>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agortnetlink.7: Document struct ifa_cacheinfo
Alex Henrie [Mon, 11 Nov 2024 06:20:06 +0000 (23:20 -0700)] 
rtnetlink.7: Document struct ifa_cacheinfo

struct ifa_cacheinfo contains the address's creation time, update time,
preferred lifetime remaining, and valid lifetime remaining.

Link: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/if_addr.h?h=v6.11#n60>
Cc: <netdev@vger.kernel.org>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Message-ID: <20241111062205.207027-1-alexhenrie24@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agomremap.2: Update information about MREMAP_DONTUNMAP restrictions
Alex Henrie [Mon, 11 Nov 2024 06:10:19 +0000 (23:10 -0700)] 
mremap.2: Update information about MREMAP_DONTUNMAP restrictions

Link: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a4609387859f0281951f5e476d9f76d7fb9ab321>
Cc: Brian Geffon <bgeffon@google.com>
Cc: <linux-mm@kvack.org>
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
Message-ID: <20241111061139.206404-1-alexhenrie24@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/lint: 'make build' does not build everything anymore
Alejandro Colomar [Thu, 7 Nov 2024 12:59:21 +0000 (13:59 +0100)] 
CONTRIBUTING.d/lint: 'make build' does not build everything anymore

Fixes: 082547cb6fbb ("share/mk/: Reduce the work of 'make && make install'")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/patches: Patches should contain a description.
Alejandro Colomar [Wed, 6 Nov 2024 22:32:51 +0000 (23:32 +0100)] 
CONTRIBUTING.d/patches/patches: Patches should contain a description.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/patches: Minor tweaks after splitting the file
Alejandro Colomar [Wed, 6 Nov 2024 22:03:29 +0000 (23:03 +0100)] 
CONTRIBUTING.d/patches/patches: Minor tweaks after splitting the file

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/sendmail: Add file documenting how to send patches
Alejandro Colomar [Wed, 6 Nov 2024 21:41:42 +0000 (22:41 +0100)] 
CONTRIBUTING.d/patches/sendmail: Add file documenting how to send patches

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/base: Add file documenting the base commit of patch sets
Alejandro Colomar [Wed, 6 Nov 2024 21:23:42 +0000 (22:23 +0100)] 
CONTRIBUTING.d/patches/base: Add file documenting the base commit of patch sets

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/range-diff: Add file documenting the range-diff between patch...
Alejandro Colomar [Wed, 6 Nov 2024 21:20:15 +0000 (22:20 +0100)] 
CONTRIBUTING.d/patches/range-diff: Add file documenting the range-diff between patch revisions

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/diff: Add file documenting the diff of a patch
Alejandro Colomar [Wed, 6 Nov 2024 21:12:08 +0000 (22:12 +0100)] 
CONTRIBUTING.d/patches/diff: Add file documenting the diff of a patch

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/description: Add file documenting the description of a patch
Alejandro Colomar [Wed, 6 Nov 2024 20:55:46 +0000 (21:55 +0100)] 
CONTRIBUTING.d/patches/description: Add file documenting the description of a patch

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/subject: Add file documenting the subject of a patch
Alejandro Colomar [Wed, 6 Nov 2024 20:46:21 +0000 (21:46 +0100)] 
CONTRIBUTING.d/patches/subject: Add file documenting the subject of a patch

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches/patches: Move file into a subdirectory
Alejandro Colomar [Wed, 6 Nov 2024 20:31:52 +0000 (21:31 +0100)] 
CONTRIBUTING.d/patches/patches: Move file into a subdirectory

This is in preparation of a split that will happen soon.

The file has grown too much, and I will split it in smaller ones that
cover different aspects of patches.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agobind.2: move EADDRNOTAVAIL to general errors
Philipp Takacs [Wed, 6 Nov 2024 09:53:47 +0000 (10:53 +0100)] 
bind.2: move EADDRNOTAVAIL to general errors

EADDRNOTAVAIL is not a socket specific error
Message-ID: <eee2fe5c6c3d6203e1e528a998b0de2c.philipp@bureaucracy.de>

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agofanotify_mark.2, fanotify.7: Update documentation of fanotify w.r.t fsid
Amir Goldstein [Tue, 5 Nov 2024 14:49:39 +0000 (15:49 +0100)] 
fanotify_mark.2, fanotify.7: Update documentation of fanotify w.r.t fsid

Clarify the conditions for getting the -EXDEV and -ENODEV errors.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Message-ID: <20241105144939.181820-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agopthread_cancel.3: tfix
Alejandro Colomar [Mon, 4 Nov 2024 23:19:10 +0000 (00:19 +0100)] 
pthread_cancel.3: tfix

Reported-by: Jona Christopher Sahnwaldt <jcsahnwaldt@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoscripts/bash_aliases: man_gitstaged(): Trim the dirname(1) only for files within...
Alejandro Colomar [Mon, 4 Nov 2024 01:01:08 +0000 (02:01 +0100)] 
scripts/bash_aliases: man_gitstaged(): Trim the dirname(1) only for files within man/

I changed the behavior at some point to trim the dirname(1) for every
file.  However, that was mainly due to the inconvenience of not having a
man/ directory.  Also, I haven't been consistent with that behavior, and
have been manually adding back the dirname(1), so let's bring back the
old behavior --which is BTW still what the comment says it does--.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/git: Specify format.thread=shallow
Alejandro Colomar [Sun, 3 Nov 2024 23:52:12 +0000 (00:52 +0100)] 
CONTRIBUTING.d/git: Specify format.thread=shallow

Setting it to true is equivalent to "shallow", but set it explicitly.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/git: Recommend merge.verifySignatures=true
Alejandro Colomar [Sun, 3 Nov 2024 22:11:27 +0000 (23:11 +0100)] 
CONTRIBUTING.d/git: Recommend merge.verifySignatures=true

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/git: Sort alphabetically
Alejandro Colomar [Sun, 3 Nov 2024 22:05:55 +0000 (23:05 +0100)] 
CONTRIBUTING.d/git: Sort alphabetically

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoshare/mk/: wsfix
Alejandro Colomar [Sun, 3 Nov 2024 17:41:27 +0000 (18:41 +0100)] 
share/mk/: wsfix

Add some spaces for readability and consistency.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoLICENSES/GPL-3.0-or-later.txt: Add license text
Alejandro Colomar [Sun, 3 Nov 2024 17:30:33 +0000 (18:30 +0100)] 
LICENSES/GPL-3.0-or-later.txt: Add license text

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoshare/mk/: lint-c: Skip some false positives
Alejandro Colomar [Sun, 3 Nov 2024 15:25:40 +0000 (16:25 +0100)] 
share/mk/: lint-c: Skip some false positives

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoetc/clang-tidy/config.yaml: -misc-include-cleaner
Alejandro Colomar [Sun, 3 Nov 2024 15:25:10 +0000 (16:25 +0100)] 
etc/clang-tidy/config.yaml: -misc-include-cleaner

We want to enable this warning again in the future, but for now it has
too many false positives.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoetc/clang-tidy/config.yaml: -cppcoreguidelines-macro-to-enum, -readability-avoid...
Alejandro Colomar [Sun, 3 Nov 2024 15:19:53 +0000 (16:19 +0100)] 
etc/clang-tidy/config.yaml: -cppcoreguidelines-macro-to-enum, -readability-avoid-nested-conditional-operator

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoman/: EXAMPLES: Fix includes
Alejandro Colomar [Sun, 3 Nov 2024 14:58:01 +0000 (15:58 +0100)] 
man/: EXAMPLES: Fix includes

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agopdfman.1: srcfix
Alejandro Colomar [Sun, 3 Nov 2024 15:19:01 +0000 (16:19 +0100)] 
pdfman.1: srcfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoshare/mk/: [un]install-bin: Add target to [un]install shell scripts
Alejandro Colomar [Sun, 3 Nov 2024 14:16:26 +0000 (15:16 +0100)] 
share/mk/: [un]install-bin: Add target to [un]install shell scripts

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoetc/shellcheck/shellcheckrc: disable=SC2250
Alejandro Colomar [Sun, 3 Nov 2024 13:20:21 +0000 (14:20 +0100)] 
etc/shellcheck/shellcheckrc: disable=SC2250

Adding braces unnecessarily adds noise and thus hurts readability.
Ignore advice.

===
In src/bin/mansect line 23:
-e '(?s)^\.SH ('"$s"')$(?:(?!^\.(lf 1|TH|SH) ).)*';
                         ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required.
===

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoetc/shellcheck/shellcheckrc: disable=SC2016
Alejandro Colomar [Sun, 3 Nov 2024 13:17:22 +0000 (14:17 +0100)] 
etc/shellcheck/shellcheckrc: disable=SC2016

This triggers false positives with trivial PCRE2 regexes.

===
In src/bin/mansect line 23:
-e '(?s)^\.SH ('"$s"')$(?:(?!^\.(lf 1|TH|SH) ).)*';
                            ^----------------------------^ SC2016 (info): Expressions don't expand in single quotes, use double quotes for that.
===

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoetc/shellcheck/shellcheckrc: disable=SC2038
Alejandro Colomar [Sun, 3 Nov 2024 13:15:36 +0000 (14:15 +0100)] 
etc/shellcheck/shellcheckrc: disable=SC2038

We don't want to support arbitrary manual-page file names.

===
In src/bin/mansect line 17:
find -H "$@" -not -type d \
        ^-----------------------^ SC2038 (warning): Use -print0/-0 or -exec + to allow for non-alphanumeric filenames.
===

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoshare/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scripts
Alejandro Colomar [Sun, 3 Nov 2024 13:11:35 +0000 (14:11 +0100)] 
share/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scripts

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agosrc/bin/pdfman: Pipe to read(1) with lastpipe
Alejandro Colomar [Sun, 3 Nov 2024 12:40:36 +0000 (13:40 +0100)] 
src/bin/pdfman: Pipe to read(1) with lastpipe

This is more readable than nested command substitution.  We already
require bash(1) for ${!#}, so we can abuse it a little bit more.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agosrc/bin/pdfman: Use command substitution instead of shell magic
Alejandro Colomar [Sun, 3 Nov 2024 11:40:19 +0000 (12:40 +0100)] 
src/bin/pdfman: Use command substitution instead of shell magic

This is significantly more readable.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agosrc/bin/pdfman, scripts/bash_aliases, pdfman.1: Make pdfman a standalone program...
Alejandro Colomar [Sun, 3 Nov 2024 11:23:01 +0000 (12:23 +0100)] 
src/bin/pdfman, scripts/bash_aliases, pdfman.1: Make pdfman a standalone program, and add a manual page

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoscripts/bash_aliases: pdfman(): Don't have custom error message
Alejandro Colomar [Sun, 3 Nov 2024 11:04:47 +0000 (12:04 +0100)] 
scripts/bash_aliases: pdfman(): Don't have custom error message

Run man(1) transparently, and let it report the error.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoscripts/bash_aliases: pdfman(): Use -Tpdf directly
Alejandro Colomar [Sun, 3 Nov 2024 05:40:55 +0000 (06:40 +0100)] 
scripts/bash_aliases: pdfman(): Use -Tpdf directly

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoscripts/bash_aliases: man_lsfunc(), man_lsvar(): Use pcre2grep(1) instead of pcregrep(1)
Alejandro Colomar [Sat, 2 Nov 2024 23:26:28 +0000 (00:26 +0100)] 
scripts/bash_aliases: man_lsfunc(), man_lsvar(): Use pcre2grep(1) instead of pcregrep(1)

pcregrep(1) is obsolete.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoscripts/bash_aliases: man_lsfunc(), man_lsvar(): Use mansect(1)
Alejandro Colomar [Sat, 2 Nov 2024 22:35:06 +0000 (23:35 +0100)] 
scripts/bash_aliases: man_lsfunc(), man_lsvar(): Use mansect(1)

Remove the man_section() function, and call the mansect(1) program
instead.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agosrc/bin/mansect, mansect.1: Add program and its manual page
Alejandro Colomar [Sat, 2 Nov 2024 22:27:13 +0000 (23:27 +0100)] 
src/bin/mansect, mansect.1: Add program and its manual page

Preprocess with preconv(1).  This doesn't process the pages in a
significant way, and has the benefit that it writes the name of the
pages in the output.

Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Colin Watson <cjwatson@debian.org>
Cc: <groff@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agosignal.7: Better description for SIGFPE
Vincent Lefevre [Tue, 24 Sep 2024 11:54:46 +0000 (13:54 +0200)] 
signal.7: Better description for SIGFPE

SIGFPE has comment "Floating-point exception", which corresponds to
the FPE acronym.  But this is misleading as this signal may also be
generated by an integer division by 0.

Change it to "Erroneous arithmetic operation" from POSIX.
Note: the GNU C Library manual says "fatal arithmetic error".

Link: <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/signal.h.html>
Link: <https://www.gnu.org/software/libc/manual/html_node/Program-Error-Signals.html>
Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/git: Recommend am.messageid=true
Alejandro Colomar [Fri, 27 Sep 2024 07:16:41 +0000 (09:16 +0200)] 
CONTRIBUTING.d/git: Recommend am.messageid=true

This is useful for maintainers.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agoCONTRIBUTING.d/patches: Documentation patches should be sent alongside the features
Alejandro Colomar [Sun, 22 Sep 2024 19:42:47 +0000 (21:42 +0200)] 
CONTRIBUTING.d/patches: Documentation patches should be sent alongside the features

Link: <https://lwn.net/Articles/989380/>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Günther Noack <gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agodup.2: ERRORS: Add ENOMEM
Levi Zim [Fri, 27 Sep 2024 06:52:29 +0000 (14:52 +0800)] 
dup.2: ERRORS: Add ENOMEM

dup2(2) could return ENOMEM under extreme condition.  For example, when
sysctl fs.nr_open=2147483584, and RLIMIT_NOFILE is also 2147483584.
The following program fails with ENOMEM:

int
main(void)
{
if (dup2(0, 2000000000) == -1)
err(1, "dup2");
return 0;
}

This ENOMEM comes from an allocation error here:
<https://elixir.bootlin.com/linux/v6.1/source/mm/util.c#L596>

ENOMEM is already documented for open(2).

Signed-off-by: Levi Zim <rsworktech@outlook.com>
[alx: tweak commit message]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
9 months agobind.2: ERRORS: Document possible errors from protocol
Lucas Culverhouse [Sun, 22 Sep 2024 02:12:20 +0000 (19:12 -0700)] 
bind.2: ERRORS: Document possible errors from protocol

When looking through the errors of socket(2) I noticed that it specifies
the selected underlying protocol may extend the potential errors
returned.  For example, using AF_PACKET and SOCK_RAW can return EPERM if
the user does not have CAP_NET_RAW or uid 0 (this is all fully
documented).

However, AF_PACKET and SOCK_RAW extend the potential errors returned
from bind(2) as well.  For example, calling bind(2) with an invalid
sll_ifindex set on the sock_addr passed in will return ENODEV.

While this possibility is documented in the raw(7) manual page, the
bind(2) manual page does not mention that its potential set of errors
can be extended by the underlying protocol.  This patch simply
duplicates the relevant language from the socket(2) manual page to the
bind(2) manual page.

It is possible further extensions for send(2), recv(2), setsockopt(2),
etc. are also undocumented, but I have not yet verified this.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agotimespec_get.3, timespec_getres.3: Add page and link page
наб [Sun, 8 Sep 2024 14:51:49 +0000 (16:51 +0200)] 
timespec_get.3, timespec_getres.3: Add page and link page

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Message-ID: <lacitlat2jwybavkgkmmsxfbzcbz532uihejn5k2boe2x5eyyy@tarta.nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoconsole_codes.4, inode.7: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:26:03 +0000 (22:26 -0500)] 
console_codes.4, inode.7: srcfix

Prepare for `MR` macro migration.

Rewrite man page cross references inside tbl(1) text blocks to use
man(7) macros instead of troff(1) font selection escape sequences.

$ cat fix-man-page-refs-in-tbl-tables-1.sed
# Rewrite man page cross references inside tbl(1) text blocks to use
# man(7) macros instead of troff(1) font selection escape sequences.
/^\.\\"/b
# Case: (handled in commit 9d21f97766, 2024-07-27)
# T{
# See \fBchown\fP(2) for
# T}
/T{$/,/^T}/s/ \\fB\([^\\]*\)\\fP\(([0-9][a-z]*)\) /\
.BR \1 \2\
/
# Case:
# T{
# the map that is loaded by the utility \fBmapscrn\fP(8).
# T}
/T{$/,/^T}/s/ \\fB\([^\\]*\)\\fP\(([0-9][a-z]*)\)\([^0-9a-z]\+\)$/\
.BR \1 \2\3/
# Case:
# T{
# by \fBxterm\fP(1)'s \fBhpLowerleftBugCompat\fP resource).
# T}
/T{$/,/^T}/s/ \\fB\([^\\]*\)\\fP\(([0-9][a-z]*)\)\([^ ]\+\) \(.*\)/\
.BR \1 \2\3\
\4/

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032603.khxdcqiqc2pxooky@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolirc.4: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:25:56 +0000 (22:25 -0500)] 
lirc.4: srcfix

Prepare for `MR` macro migration.

Migrate man page cross references in "SEE ALSO" section from using font
selection escape sequences to font alternation macros to set man page
cross references.

This is an oddball case where `\-` appears in the man page title and,
for no obvious reason, a nonbreaking space escape sequence was applied
between list items.  (I can _guess_ why: someone was trying to defeat
line adjustment, and didn't notice that they were trying to do so right
before a paragraph break, so adjustment wouldn't have happened anyway.)

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032556.mmrwd27rpr3zzb5s@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosuffixes.7: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:25:48 +0000 (22:25 -0500)] 
suffixes.7: srcfix

Prepare for `MR` macro migration.

Migrate man page cross references in table rows from using font
selection escape sequences to font alternation macros to set man page
cross references.

These are a handful of cases that made a sed(1)-scripted migration
ordering-dependent with its substitution ('s') commands.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032548.olkeoqjwpj76h42b@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoutmp.5: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:25:30 +0000 (22:25 -0500)] 
utmp.5: srcfix

Prepare for `MR` macro migration.

Migrate man page cross references in unfilled examples from using font
selection escape sequences to font alternation macros to set man page
cross references.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032530.wrvbtb4wisgnkcns@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoutmp.5: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:25:23 +0000 (22:25 -0500)] 
utmp.5: srcfix

Set init(1) man page cross references like all the others in the page.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032523.qsfzdca46pcr524f@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agowctrans.3, wctype.3: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:25:13 +0000 (22:25 -0500)] 
wctrans.3, wctype.3: srcfix

Convert from unfilled text using `nf` and `fi` requests to `IP` macro
calls and tbl(1) tables.

This change increases the item indentation slightly, as I elected not to
specify one in the `IP` calls.  The content still fits easily in an
80-column terminal.

The reason for this change is to make the man page cross references
susceptible to scripted rewriting (and ultimately to make them
hyperlinkable).  See, e.g.,
<https://lore.kernel.org/linux-man/20240831182027.b6pduwkthk5b3tcf@illithid/>.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032513.afty634vpnhe24zi@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agonamespaces.7: srcfix
G. Branden Robinson [Sun, 1 Sep 2024 03:25:05 +0000 (22:25 -0500)] 
namespaces.7: srcfix

Use *roff requests to shut off adjustment and hyphenation for the
rightmost column of the table, which uses text blocks.  (In man pages,
use of such requests _outside_ of tbl(1) text blocks remains discouraged
by groff(1) and mandoc(1) developers.)

Also break filled input lines less aggressively.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032505.ralmc2yuwd4psgos@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agonamespaces.7: ffix
G. Branden Robinson [Sun, 1 Sep 2024 03:24:53 +0000 (22:24 -0500)] 
namespaces.7: ffix

Put a paragraph break above the table to ensure separation from the
preceding paragraph with the man(7) macros from groff >= 1.23 and
forthcoming mandoc(1) release.

Draw a horizontal rule under the column headings.

Link: <https://cvsweb.bsd.lv/mandoc/man_term.c?rev=1.241&content-type=text/x-cvsweb-markup>
Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240901032453.3dmhjz7urk2saizq@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoCONTRIBUTING.d/git: Recommend format.thread=true
Alejandro Colomar [Sat, 31 Aug 2024 21:38:20 +0000 (23:38 +0200)] 
CONTRIBUTING.d/git: Recommend format.thread=true

This generates patch sets as threads, with a Message-ID pre-set for the
first mail.

Cc: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agonamespaces.7: ffix
G. Branden Robinson [Sat, 31 Aug 2024 18:20:57 +0000 (13:20 -0500)] 
namespaces.7: ffix

Prepare for `MR` macro migration.

Let the table columns breathe again.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240831182057.u6mza33uhz55j3xd@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoman/: srcfix
G. Branden Robinson [Sat, 31 Aug 2024 18:20:45 +0000 (13:20 -0500)] 
man/: srcfix

Prepare for `MR` macro migration.

Explicitly set the width of certain table columns so that they don't
change or cause "can't break line" warnings from troff(1) when the rows
are converted to use text blocks.

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240831182045.kvhjjxbztnhudjga@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoman/: srcfix
G. Branden Robinson [Sat, 31 Aug 2024 18:20:27 +0000 (13:20 -0500)] 
man/: srcfix

Prepare for `MR` macro migration.

Migrate table entries from using font selection escape sequences to font
alternation macros to set man page cross references.

This change was automatically driven by the following sed(1) script.

$ cat fix-man-page-refs-in-tbl-tables-2.sed
# Rewrite man page cross references on tbl(1) rows that
# precede text blocks to themselves use text blocks,
# and convert them to use man(7) macros
# instead of troff(1) font selection escape sequences
# (which cannot be done outside a text block).
/^\.\\"/b
/^\\fB[^\\]*\\fP([0-9][a-z]*).*T{/s/\\fB\([^\\]*\)\\fP\(([0-9][a-z]*)\)\(.*\)/T{\
.BR \1 \2\
T}\3/

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240831182027.b6pduwkthk5b3tcf@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agotzset.3: CAVEATS: Document the inability of tzset() to report errors
Alejandro Colomar [Fri, 30 Aug 2024 11:49:31 +0000 (13:49 +0200)] 
tzset.3: CAVEATS: Document the inability of tzset() to report errors

NetBSD has tzalloc(3), which returns NULL to report invalid tme zones.

Cc: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoctime.3: EXAMPLES: Document how to detect invalid or ambiguous times
Alejandro Colomar [Fri, 23 Aug 2024 22:51:55 +0000 (00:51 +0200)] 
ctime.3: EXAMPLES: Document how to detect invalid or ambiguous times

This example documents how to detect some corner cases of mktime(3),
such as DST transitions and other jumps in the calendar.

Link: <https://www.redhat.com/en/blog/brief-history-mktime>
Cc: DJ Delorie <dj@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoctime.3: CAVEATS: Add note about tm_isdst handling in mktime(3)
DJ Delorie [Fri, 30 Aug 2024 01:10:32 +0000 (21:10 -0400)] 
ctime.3: CAVEATS: Add note about tm_isdst handling in mktime(3)

Handling of "invalid" values for tm_isdst is not clearly specified
in any standard, and implementations vary as to how they react when you
(for example) pass tm_isdst=1 at a time when DST is not in effect.
Add a note about this, and a suggestion for a workaround.

I go into further detail about this in the link below.

Link: <https://www.redhat.com/en/blog/brief-history-mktime>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: DJ Delorie <dj@redhat.com>
Message-ID: <xncylqiznb.fsf@greed.delorie.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agopipe.7: Document change to default pipe size when soft limit is exceeded
Kienan Stewart [Thu, 29 Aug 2024 20:44:49 +0000 (16:44 -0400)] 
pipe.7: Document change to default pipe size when soft limit is exceeded

See Linux commit 46c4c9d1beb7f5b4cec4dd90e7728720583ee348
("pipe: increase minimum default pipe size to 2 pages").

Cc: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Message-ID: <20240829204448.2027276-2-kstewart@efficios.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agopipe.7: Reference potential lower default in "Pipe capacity" sub-section
Kienan Stewart [Thu, 29 Aug 2024 15:43:04 +0000 (11:43 -0400)] 
pipe.7: Reference potential lower default in "Pipe capacity" sub-section

The default capacity of pipes is two pages for users exceeding the
pipe-user-pages-soft limit.  Before Linux 5.14, it was only one page.

Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Message-ID: <20240829154304.2010305-2-kstewart@efficios.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agodlinfo.3: Document the RTLD_DI_PHDR request
Florian Weimer [Wed, 28 Aug 2024 11:01:56 +0000 (13:01 +0200)] 
dlinfo.3: Document the RTLD_DI_PHDR request

First added in glibc 2.36, backported upstream to glibc 2.34,
so mention 2.34.1 for the first version.

Signed-off-by: Florian Weimer <fweimer@redhat.com>
Message-ID: <87o75chpwb.fsf@oldenburg.str.redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoshare/mk/: build-pdf-book: Rename book to "GNU/Linux Programmer's Manual"
Alejandro Colomar [Tue, 27 Aug 2024 09:48:58 +0000 (11:48 +0200)] 
share/mk/: build-pdf-book: Rename book to "GNU/Linux Programmer's Manual"

The manual pages in this project had historically used the 5th argument
to TH, with the string "Linux Programmer's Manual".  This was showed as
the center-top title of the pages.  This was incidentally consistent
with the UNIX Programmer's Manual.

A few years ago, I removed the 5th argument to TH to use the default
string, to follow conventions.  At the same time, I put the project name
and version in the 4th argument to TH: "Linux man-pages X.Y".

When we added the scripts written by Deri to produce a PDF book, the
title of the book was "The Linux Manpage Book", and the front page said
"GNU/Linux\nTHE MAN PAGES BOOK".  For consistency with the project name,
I changed those some time ago to be title: "The Linux man-pages Book"
and front: "GNU/Linux\nTHE MAN-PAGES BOOK".

However, for consistency with the UNIX Programmer's Manual, and with the
old title used within the project, I'm now (partially) restoring the
title of the book and its front page to be both:
"GNU/Linux Programmer's Manual".
(It's not fully restorative, because it has GNU/Linux where the old
 title had just Linux, but half of our documentation is for glibc, so I
 think it's deserved.)
(I was never convinced by the old front text: why should it have the
 word "book"?)

Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Deri James <deri@chuzzlewit.myzen.co.uk>
Cc: "Michael T. Kerrisk" <mtk.manpages@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agostatx.2: Document AT_EMPTY_PATH allows using NULL instead of "" for pathname
Xi Ruoyao [Tue, 27 Aug 2024 10:25:19 +0000 (18:25 +0800)] 
statx.2: Document AT_EMPTY_PATH allows using NULL instead of "" for pathname

Link: <https://git.kernel.org/torvalds/c/0ef625bba6fb>
Cc: Mateusz Guzik <mjguzik@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Xi Ruoyao <xry111@xry111.site>
Message-ID: <20240827102518.43332-2-xry111@xry111.site>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoshare/mk/: $CLANG_CFLAGS: -Wno-used-but-marked-unused
Alejandro Colomar [Tue, 27 Aug 2024 09:26:00 +0000 (11:26 +0200)] 
share/mk/: $CLANG_CFLAGS: -Wno-used-but-marked-unused

This diagnostic is triggered by valid calls to printf(3).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosplice.2: EXAMPLES: Add example program
Alejandro Colomar [Tue, 27 Aug 2024 09:19:07 +0000 (11:19 +0200)] 
splice.2: EXAMPLES: Add example program

This example demonstrates the use of off_out, which the tee(2) example
doesn't use.

Here's a run of the program:

$ gcc -Wall -Wextra splice.c
$ ./a.out
New offset is 22
$ echo $?
0
$ hd out
00000000  00 00 00 00 00 00 00 00  00 00 48 65 6c 6c 6f 2c  |..........Hello,|
00000010  20 77 6f 72 6c 64                                 | world|
00000016

Link: <https://lore.kernel.org/linux-man/4xw464u2munxbgujopgfggxvnvgxa2b5lh35eriaeziapaa4uq@z6jmdim6f5mo/T/#t>
Co-developed-by: Absee Seeab <doesnt.look.like.temp.mail@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosplice.2: off_{in,out} are updated by splice(2)
Alejandro Colomar [Tue, 27 Aug 2024 08:21:36 +0000 (10:21 +0200)] 
splice.2: off_{in,out} are updated by splice(2)

Link: <https://lore.kernel.org/linux-man/4xw464u2munxbgujopgfggxvnvgxa2b5lh35eriaeziapaa4uq@z6jmdim6f5mo/T/#t>
Reported-by: Absee Seeab <doesnt.look.like.temp.mail@gmail.com>
Co-developed-by: Absee Seeab <doesnt.look.like.temp.mail@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoshare/mk/: $CLANG_CFLAGS: -Wno-unreachable-code
Alejandro Colomar [Tue, 27 Aug 2024 09:22:11 +0000 (11:22 +0200)] 
share/mk/: $CLANG_CFLAGS: -Wno-unreachable-code

The example program in ctime(3) triggers that diagnostic due to a
compile-time check of the signedness of time_t.  The code is legitimate.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoctime.3: Move NOTES to a subsection within CAVEATS
Alejandro Colomar [Fri, 23 Aug 2024 22:20:49 +0000 (00:20 +0200)] 
ctime.3: Move NOTES to a subsection within CAVEATS

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoctime.3: Document how to check errors from mktime(3)
Alejandro Colomar [Fri, 23 Aug 2024 12:34:00 +0000 (14:34 +0200)] 
ctime.3: Document how to check errors from mktime(3)

-1 is a valid successful time_t, for one second before the Epoch.  And
mktime(3) is allowed (like most libc calls) to set errno on success.
This makes it impossible to determine errors from the return value or
errno.

ISO C specifies that tp->tm_wday is unmodified after a failed call, and
puts an example where this is used to determine errors.  It is indeed
the only way to check for errors from this call.

Document this detail in the RETURN VALUE section, add a CAVEATS section
that warns about this, and write an example program that shows how to
properly call this function.

Most code I've been able to find in several search engines either
doesn't check for errors after mktime(3), or checks them incorrectly, so
this documentation should help fix those.

This is guaranteed since ISO C23 and POSIX.1-2024.  Prior to those
standards, there was no standard way to check for errors.  However,
there are no known implementations that do not conform to this.

Link: <https://lore.kernel.org/linux-man/20240823131024.GD2713@cventin.lip.ens-lyon.fr/T/#t>
Link: <https://lore.kernel.org/linux-man/6un6baaq5tez23irtycuvzqtuh7a4sdrf2px7tnyb3y6iqoxmq@2ofln4cd27ep/T/#t>
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3147.txt>
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3148.doc>
Link: <https://austingroupbugs.net/view.php?id=1614>
Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf#subsubsection.7.29.2.3>
Reported-by: Paul Eggert <eggert@cs.ucla.edu>
Cc: Vincent Lefevre <vincent@vinc17.net>
Cc: DJ Delorie <dj@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Cc: Xi Ruoyao <xry111@xry111.site>
Cc: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Cc: "Robert C. Seacord" <rcseacord@gmail.com>
Cc: Jens Gustedt <jens.gustedt@inria.fr>
Cc: Robert Elz <kre@munnari.oz.au>
Cc: Andrew Josey <ajosey@opengroup.org>
Cc: Geoff Clare <gwc@opengroup.org>
Cc: Hans Åberg <haberg-1@telia.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Cc: Austin Group <austin-group-l@opengroup.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_*.2const: Make sashimi
Alejandro Colomar [Sat, 17 Aug 2024 23:48:00 +0000 (01:48 +0200)] 
keyctl.2, KEYCTL_*.2const: Make sashimi

11 months agokeyctl.2: Tweak after making sashimi of this page
Alejandro Colomar [Sat, 17 Aug 2024 23:43:53 +0000 (01:43 +0200)] 
keyctl.2: Tweak after making sashimi of this page

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_RESTRICT_KEYRING.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 23:40:29 +0000 (01:40 +0200)] 
KEYCTL_RESTRICT_KEYRING.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_RESTRICT_KEYRING.2const: Split KEYCTL_RESTRICT_KEYRING from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 23:31:55 +0000 (01:31 +0200)] 
keyctl.2, KEYCTL_RESTRICT_KEYRING.2const: Split KEYCTL_RESTRICT_KEYRING from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_DH_COMPUTE.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 23:23:46 +0000 (01:23 +0200)] 
KEYCTL_DH_COMPUTE.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>