get_nprocs.3, get_nprocs_conf.3, program_invocation_name.3, sysvipc.7: Match page title with file name and NAME section
Manually tweak a few pages that weren't covered by the scripts
used in the 2 previous commits.
On 10/30/22 23:00, G. Branden Robinson wrote:
> For those to whom this change is coming as an unpleasant surprise, the
> forthcoming groff 1.23.0 features an option that will reverse this
> change at rendering time.
>
> From groff_man(7):
>
> -rCT=1 Capitalize titles, setting the man page title (the first
> argument to .TH) in full capitals in headers and footers.
> This transformation is off by default because it discards
> case distinction information.
>
> This register can also be set in a site-local "man.local" file to force
> it on for all pages. On Debian-based systems, this file is in
> /etc/groff. The following line will do the trick.
>
> .nr CT 1
>
> The groff_man_style(7) man page offers further examples of such
> rendering customization.
>
> /usr/local/share/groff/site-tmac/man.local
> Put site‐local changes and customizations into this file.
>
> .\" Use narrower indentation on terminals and similar.
> .if n .nr IN 4n
> .\" Put only one space after the end of a sentence.
> .ss 12 0 \" See groff(7).
> .\" Keep pages narrow even on wide terminals.
> .if n .if \n[LL]>78n .nr LL 78n
> .\" Ensure hyperlinks are enabled for terminals.
> .nr U 1
>
> On multi‐user systems, it is more considerate to users whose
> preferences may differ from the administrator’s to be less
> aggressive with such settings, or to permit their override
> with a user‐specific man.local file. This can be achieved by
> placing one or both of following requests at the end of the
> site‐local file.
> .soquiet \V[XDG_CONFIG_HOME]/man.local
> .soquiet \V[HOME]/.man.local
> However, a security‐sandboxed man(1) program may lack
> permission to open such files.
Various pages: Use correct letter case in page titles (TH)
Semi-scripted change:
$ find man* -type f \
| xargs grep -L '\.so' \
| while read f; do
P=$(basename $f);
T=$(grep '\.TH ' $f | cut -f2,3 -d' ' | sed 's/ /./');
p=$(echo $P | tr '[:upper:]' '[:lower:]');
t=$(echo $T | tr '[:upper:]' '[:lower:]');
Tn=$(echo $T | sed 's/\.[^.]\+$//')
Pn=$(echo $P | sed 's/\.[^.]\+$//')
N=$(man_section $f NAME \
| sed -n '/NAME/,/ - /p' \
| sed 's/ - .*//' \
| grep -v '^NAME$' \
| tr ', ' '\n' \
| grep -i "^$Pn$" \
| head -n1)
test $P = $T \
&& test -n $N \
&& continue;
if test "x$p" != "x$t"; then
echo 1 $P $T $N;
elif test -z "$N"; then
sed -i "/\.TH /s/$Tn/$Pn/" $f;
fi;
done;
Most of the changes produced by this script needed to be reverted,
but the some of them were good.
On 10/30/22 23:00, G. Branden Robinson wrote:
> For those to whom this change is coming as an unpleasant surprise, the
> forthcoming groff 1.23.0 features an option that will reverse this
> change at rendering time.
>
> From groff_man(7):
>
> -rCT=1 Capitalize titles, setting the man page title (the first
> argument to .TH) in full capitals in headers and footers.
> This transformation is off by default because it discards
> case distinction information.
>
> This register can also be set in a site-local "man.local" file to force
> it on for all pages. On Debian-based systems, this file is in
> /etc/groff. The following line will do the trick.
>
> .nr CT 1
>
> The groff_man_style(7) man page offers further examples of such
> rendering customization.
>
> /usr/local/share/groff/site-tmac/man.local
> Put site‐local changes and customizations into this file.
>
> .\" Use narrower indentation on terminals and similar.
> .if n .nr IN 4n
> .\" Put only one space after the end of a sentence.
> .ss 12 0 \" See groff(7).
> .\" Keep pages narrow even on wide terminals.
> .if n .if \n[LL]>78n .nr LL 78n
> .\" Ensure hyperlinks are enabled for terminals.
> .nr U 1
>
> On multi‐user systems, it is more considerate to users whose
> preferences may differ from the administrator’s to be less
> aggressive with such settings, or to permit their override
> with a user‐specific man.local file. This can be achieved by
> placing one or both of following requests at the end of the
> site‐local file.
> .soquiet \V[XDG_CONFIG_HOME]/man.local
> .soquiet \V[HOME]/.man.local
> However, a security‐sandboxed man(1) program may lack
> permission to open such files.
Many pages: Use correct letter case in page titles (TH)
Scripted change:
$ find man* -type f \
| xargs grep -L '\.so' \
| while read f; do
P=$(basename $f);
T=$(grep '\.TH ' $f | cut -f2,3 -d' ' | sed 's/ /./');
p=$(echo $P | tr '[:upper:]' '[:lower:]');
t=$(echo $T | tr '[:upper:]' '[:lower:]');
Tn=$(echo $T | sed 's/\.[^.]\+$//')
Pn=$(echo $P | sed 's/\.[^.]\+$//')
N=$(man_section $f NAME \
| sed -n '/NAME/,/ - /p' \
| sed 's/ - .*//' \
| grep -v '^NAME$' \
| tr ', ' '\n' \
| grep -i "^$Pn$" \
| head -n1)
test $P = $T \
&& test -n $N \
&& continue;
if test "x$p" != "x$t"; then
echo 1 $P $T $N;
elif test -z "$N"; then
echo 2 $P $T $N;
else
sed -i "/\.TH /s/$Tn/$N/" $f;
fi;
done;
On 10/30/22 23:00, G. Branden Robinson wrote:
> For those to whom this change is coming as an unpleasant surprise, the
> forthcoming groff 1.23.0 features an option that will reverse this
> change at rendering time.
>
> From groff_man(7):
>
> -rCT=1 Capitalize titles, setting the man page title (the first
> argument to .TH) in full capitals in headers and footers.
> This transformation is off by default because it discards
> case distinction information.
>
> This register can also be set in a site-local "man.local" file to force
> it on for all pages. On Debian-based systems, this file is in
> /etc/groff. The following line will do the trick.
>
> .nr CT 1
>
> The groff_man_style(7) man page offers further examples of such
> rendering customization.
>
> /usr/local/share/groff/site-tmac/man.local
> Put site‐local changes and customizations into this file.
>
> .\" Use narrower indentation on terminals and similar.
> .if n .nr IN 4n
> .\" Put only one space after the end of a sentence.
> .ss 12 0 \" See groff(7).
> .\" Keep pages narrow even on wide terminals.
> .if n .if \n[LL]>78n .nr LL 78n
> .\" Ensure hyperlinks are enabled for terminals.
> .nr U 1
>
> On multi‐user systems, it is more considerate to users whose
> preferences may differ from the administrator’s to be less
> aggressive with such settings, or to permit their override
> with a user‐specific man.local file. This can be achieved by
> placing one or both of following requests at the end of the
> site‐local file.
> .soquiet \V[XDG_CONFIG_HOME]/man.local
> .soquiet \V[HOME]/.man.local
> However, a security‐sandboxed man(1) program may lack
> permission to open such files.
Zach O'Keefe [Fri, 21 Oct 2022 22:32:58 +0000 (15:32 -0700)]
madvise.2: document reliable probe for advice support
EINVAL is an overloaded error code for madvise(2) and it's not clear
under what context it means "advice is not valid" vs another error.
Explicitly document that madvise(0, 0, advice) can reliably be used to
probe for kernel support for "advice", returning zero iff "advice" is
supported by the kernel.
Zach O'Keefe [Fri, 21 Oct 2022 22:32:57 +0000 (15:32 -0700)]
madvise.2: update THP file/shmem documentation for +5.4
Since Linux 5.4, Transparent Huge Pages now support both file-backed
memory and shmem memory. Update MADV_HUGEPAGE advice description to
reflect this.
Additionally, expand the description of requirements for memory to be
considered eligible for THP: alignment / mapping requirements, VMA
flags, prctl(2) settings, inode status, etc.
Tagged paragraphs
These are fixed in a separate commit (the previous one).
They are used for a list of tags and their descriptions.
An example is this commit message itself.
Ordered lists
Elements are preceeded by a number in parentheses.
These represent a set of steps that have an order.
When there are substeps, they will be numbered like (4.2).
Positional lists
Elements are preceeded by a number in square brackets
(index). These represent fields in a set. The index will
start at:
0 fields of a C data structure, to be consistent
with arrays.
1 fields of a file, to be consistent with tools like
cut(1).
Alternatives list
Elements are preceeded by a letter in parentheses.
These represent a set of (normally) exclusive
alternatives.
Bullet lists
Elements are preceeded by bullet symbols. Anything that
doesn't fit elsewhere usually is covered by this type of
list.
Notes
Not really a list, but the syntax is identical to
"positional lists".
There should always be 2 spaces between the list symbol and the
elements. This doesn't apply to "tagged paragraphs", which use
the default indentation rules.
Reported-by: Mike Frysinger <vapier@gentoo.org> Cc: <groff@gnu.org> Acked-by: Douglas McIlroy <douglas.mcilroy@dartmouth.edu> Signed-off-by: Alejandro Colomar <alx@kernel.org>
наб [Mon, 17 Oct 2022 01:22:57 +0000 (03:22 +0200)]
ascii.7: Chase down History to earliest
Cf., well, the UNIX Programmer's Manual:
https://www.tuhs.org/Archive/Distributions/Research/Dennis_v1/UNIX_ProgrammersManual_Nov71.pdf
PDF page 191; yes, the typographical convention here is insane, and
the contemprary-correct way to refer to this page from within the manual
would be /just/ "/etc/ascii", but, given the context, "/etc/ascii (VII)"
makes the most sense to me
dist.mk: Force adding version to tarball man pagesat 'make dist'
When creating a tarball with 'make dist', force the addition of
the date and version to the pages. Otherwise, if a tarball had
already been created from a previous commit, and the page hasn't
been touched, make will consider the one in the tarball
up-to-date, and will keep the old version.
Makefile: Remove installdirs* and builddirs* targets
Since our makefiles correctly state the dependencies of all
targets, and allow fully-parallel builds and installs, there's no
reason at all to allow creating the directories separately. That
was an old recommendation for when makefiles were buggy, and you
couldn't fully trust in them not having races or incorrect
dependencies.
It's obvious that it belongs to man-pages, since it's inside the
repository tree. Also, since the file is emailed to the LSM
project, it doesn't matter what name we give to it. Let's
simplify the name.
Now only MANDIRS start with 'man*', which is a good thing.
Let's start making the repository self-contained. The README
should be enough to guide a user into everything that has to do
with the project. The website should be a secondary source, for
those who don't know about the repository yet.
I merged some of the information found in the .Announce file,
which I'll remove.
cmd.mk, install.mk: Avoid modifying existing directories at 'make install'
'install -d' has an issue compared to 'mkdir -p': it doesn't
respect existing directories. It will set the ownership, file
mode, and SELinux contexts (and any other property that would be
set by install(1) to a newly-created directory), overwriting any
existing properties of the existing directory.
'mkdir -p' doesn't have this issue: it is a no-op if the
directory exists. However, it's not an ideal solution either,
since it can't be used to set the properties (owner, mode, ...) of
a newly-created directory.
Therefore, the best solution is to use install(1), but only after
making sure that the directory doesn't exist with test(1).
Some notes:
* glibc is the only libc I'm aware of implementing _TIME_BITS for time64
compatibility. It was introduced in glibc-2.34;
* musl libc made a hard switch in 1.2.0, see https://musl.libc.org/time64.html;
* Using _TIME_BITS=64 with glibc requires _FILE_OFFSET_BITS=64 (which is used
for Large File Support)! Extraordinary claims require (some) evidence, so see
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/features-time64.h;h=84d56ee3ff2ecfa0d2499385623f30606f84a1bf.
Reference: https://wiki.gentoo.org/wiki/Project:Toolchain/time64_migration
Reference: https://sourceware.org/pipermail/libc-alpha/2022-January/134985.html Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
dist.mk, All pages: .TH: Generate date at 'make dist'
Replace the date by a placeholder (date) in the repo, as we're
doing with the version (unreleased). It will be filled when the
tarball is generated with 'make dist' (or equivalent) with the
date of the most recent git commit that modifies the page (as was
done previously by update_timestamps.sh, which has been removed).
Amir Goldstein [Fri, 7 Oct 2022 06:13:28 +0000 (09:13 +0300)]
fanotify_mark.2: Document FAN_MARK_IGNORE
A new flavor of FAN_MARK_IGNORED_MASK that helps to resolve the
ambiguity around the combination of event flags and ignore mask.
It is also more strict in the events and flags allowed to be
set in a non-directory inode mark mask and it mandates the use
of FAN_MARK_IGNORED_SURV_MODIFY flag on filesystem, mount and
directory inode marks.
Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Matthew Bobrowski <repnop@google.com> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
"KernelPageSize" and "MMUPageSize" are repeated in the
/proc/[pid]/smaps format example.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com> Fixes: 6861f8f0c7 "proc.5: Improve description of the KernelPageSize and [...]" Signed-off-by: Alejandro Colomar <alx@kernel.org>
Mike Frysinger [Tue, 27 Sep 2022 07:41:32 +0000 (13:26 +0545)]
unix.7: fix section reference wrt length
The description of Linux path length handling has always been in the
BUGS section. The commit that added this see-also note incorrectly
referred to the NOTES section instead.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
Alex Colomar [Thu, 15 Sep 2022 14:40:27 +0000 (16:40 +0200)]
Various pages: EXAMPLES: Use unsigned types for loop iterators
Looping with unsigned types is safer. See the link below.
When the iterators are used for accessing an array, use size_t;
otherwise, use the most appropriate unsigned type, which in most
cases is just 'unsigned int'.
Also adjust other variables that have to interact with the
iterators, to avoid comparison of integers of different
signedness.
Link: <https://gustedt.wordpress.com/2013/07/15/a-praise-of-size_t-and-other-unsigned-types/> Cc: Jens Gustedt <jens.gustedt@inria.fr> Signed-off-by: Alex Colomar <alx.manpages@gmail.com>
Alex Colomar [Mon, 12 Sep 2022 22:56:22 +0000 (00:56 +0200)]
Various pages: EXAMPLES: Use <err.h> functions
When reporting errors, prefer using conventional <err.h>
functions, rather than home-made macros. Home-made macros are
necessary for portable programs, so in documentation about
portable functions, keep using the macros. However, in the
documentation for functions that are only available in GNU/Linux
and/or BSD systems, prefer <err.h>, which is available in both
systems.
Do the same in example programs documenting portable functions but
in which we already require _GNU_SOURCE for some other reason.
Signed-off-by: Alex Colomar <alx.manpages@gmail.com>