]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
3 years agoarc4random_buf.3, arc4random_uniform.3: Add links to arc4random(3)
Alejandro Colomar [Sun, 1 Jan 2023 16:43:17 +0000 (17:43 +0100)] 
arc4random_buf.3, arc4random_uniform.3: Add links to arc4random(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoarc4random.3: New page documenting the arc4random(3) family of functions
Alejandro Colomar [Sun, 1 Jan 2023 16:18:22 +0000 (17:18 +0100)] 
arc4random.3: New page documenting the arc4random(3) family of functions

arc4random(3)
arc4random_uniform(3)
arc4random_buf(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agopowerof2.3: New page documenting powerof2(3)
Alejandro Colomar [Sat, 31 Dec 2022 01:58:34 +0000 (02:58 +0100)] 
powerof2.3: New page documenting powerof2(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agobstring.3: bcopy(3)'s replacement is memmove(3), not memcpy(3)
Alejandro Colomar [Fri, 30 Dec 2022 23:04:06 +0000 (00:04 +0100)] 
bstring.3: bcopy(3)'s replacement is memmove(3), not memcpy(3)

Reported-by: Aaron Peter Bachmann <aaron_ng@inode.at>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agobstring.3: bzero(3) is not deprecated in my book
Alejandro Colomar [Fri, 30 Dec 2022 23:02:24 +0000 (00:02 +0100)] 
bstring.3: bzero(3) is not deprecated in my book

It is technically superior to memset(3) in every way.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoscripts: tfix
Samanta Navarro [Fri, 30 Dec 2022 12:03:54 +0000 (12:03 +0000)] 
scripts: tfix

Typos found with codespell.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agobpf-helpers.7, open_how.2type, string_copying.7: tfix
Samanta Navarro [Fri, 30 Dec 2022 12:03:02 +0000 (12:03 +0000)] 
bpf-helpers.7, open_how.2type, string_copying.7: tfix

Typos found with codespell.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agorand.3: SYNOPSIS: Mark rand_r() as deprecated
Alejandro Colomar [Fri, 30 Dec 2022 11:26:03 +0000 (12:26 +0100)] 
rand.3: SYNOPSIS: Mark rand_r() as deprecated

POSIX.1-2008 says so, and it's not a very useful function either.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agomemchr.3: The function always returns a pointer to the match
Alejandro Colomar [Thu, 29 Dec 2022 19:21:52 +0000 (20:21 +0100)] 
memchr.3: The function always returns a pointer to the match

Otherwise, it means we're deep into UB lands, and there be dragons.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agorand.3: EXAMPLES: Show how to get a random seed
Alejandro Colomar [Thu, 29 Dec 2022 17:13:23 +0000 (18:13 +0100)] 
rand.3: EXAMPLES: Show how to get a random seed

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>
3 years agoMany pages: Remove references to C89
Alejandro Colomar [Thu, 29 Dec 2022 17:03:24 +0000 (18:03 +0100)] 
Many pages: Remove references to C89

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>
3 years agoscanf.3, sscanf.3, vsscanf.3: Split the page, one for strings and one for FILEs
Alejandro Colomar [Thu, 29 Dec 2022 11:21:28 +0000 (12:21 +0100)] 
scanf.3, sscanf.3, vsscanf.3: Split the page, one for strings and one for FILEs

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>
3 years agoREADME: The git repo now covers the full history
Alejandro Colomar [Thu, 29 Dec 2022 10:36:00 +0000 (11:36 +0100)] 
README: The git repo now covers the full history

See the 'prehistory' branch in the git repo for pre-1.70 versions.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocharsets.7: tfix
Lennart Jablonka [Tue, 27 Dec 2022 19:43:41 +0000 (19:43 +0000)] 
charsets.7: tfix

Signed-off-by: Lennart Jablonka <humm@ljabl.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring_copying.7: Remove stpecpyx()
Alejandro Colomar [Sat, 24 Dec 2022 01:29:27 +0000 (02:29 +0100)] 
string_copying.7: Remove stpecpyx()

And give stpecpy() with the semantics of stpecpyx().

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoscripts/LinuxManBook/: Add Deri's script for producing the man-pages book
Alejandro Colomar [Fri, 23 Dec 2022 23:04:57 +0000 (00:04 +0100)] 
scripts/LinuxManBook/: Add Deri's script for producing the man-pages book

Deri is the author of all of this great work!

I expect to be able to hook it into the build system, so that we can run
`make book-pdf` (or something like that).

Cc: Deri James <deri@chuzzlewit.myzen.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring_copying.7: tfix
Alejandro Colomar [Thu, 22 Dec 2022 22:14:51 +0000 (23:14 +0100)] 
string_copying.7: tfix

Reported-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoRELEASE: Fix command
Alejandro Colomar [Thu, 22 Dec 2022 19:44:45 +0000 (20:44 +0100)] 
RELEASE: Fix command

git-push(1) needs a remote for pushing a tag.  Specify korg, my name for
the git.kernel.org remote.

$ git remote -v | grep korg
korg git@gitolite.kernel.org:pub/scm/docs/man-pages/man-pages (fetch)
korg git@gitolite.kernel.org:pub/scm/docs/man-pages/man-pages (push)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoStart of man-pages-NEXT: Move Changes to Changes.old
Alejandro Colomar [Thu, 22 Dec 2022 19:41:00 +0000 (20:41 +0100)] 
Start of man-pages-NEXT: Move Changes to Changes.old

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agolsm: Released 6.02
Alejandro Colomar [Thu, 22 Dec 2022 19:29:01 +0000 (20:29 +0100)] 
lsm: Released 6.02

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoChanges: Ready for 6.02 man-pages-6.02
Alejandro Colomar [Thu, 22 Dec 2022 18:58:13 +0000 (19:58 +0100)] 
Changes: Ready for 6.02

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncat.3: EXAMPLES: Check the return of malloc(3)
Alejandro Colomar [Wed, 21 Dec 2022 21:38:54 +0000 (22:38 +0100)] 
strncat.3: EXAMPLES: Check the return of malloc(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrcpy.3: EXAMPLES: Check the return of malloc(3)
Alejandro Colomar [Wed, 21 Dec 2022 21:35:37 +0000 (22:35 +0100)] 
strcpy.3: EXAMPLES: Check the return of malloc(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring_copying.7: tfix
Alejandro Colomar [Tue, 20 Dec 2022 15:02:07 +0000 (16:02 +0100)] 
string_copying.7: tfix

Reported-by: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agosuffixes.7: Improve table format
G. Branden Robinson [Tue, 20 Dec 2022 03:18:16 +0000 (21:18 -0600)] 
suffixes.7: Improve table format

Apparently the original author(s) of this table did not know how to
start a table entry in the first column of a tbl(1) table with a dot.
(If you try, the *roff formatter will interpret it as a control line,
and try to invoke a request or call a macro.)

Start every row of the table with the *roff dummy character `\&` instead
of leading space.  Not only is this more idiomatic, but it recovers some
of the line length for content.

This patch does not attempt to correct any errors in the table contents,
nor bring it up to date from its year 2000 vintage.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agosuffixes.7: Drop diagnostic-suppressing hack
G. Branden Robinson [Tue, 20 Dec 2022 03:18:01 +0000 (21:18 -0600)] 
suffixes.7: Drop diagnostic-suppressing hack

The extension of the page length is workaround for
<https://savannah.gnu.org/bugs/?63449>, which is a very old groff bug,
possibily dating back to groff 1.00 or beyond.  It is fixed in groff
Git.  But waiting for a groff release is not necessary; man-db man(1)
nowadays conceals diagnostic messages from the formatter and output
drivers.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncat.3: Rewrite to be consistent with string_copying.7
Alejandro Colomar [Wed, 14 Dec 2022 23:14:43 +0000 (00:14 +0100)] 
strncat.3: Rewrite to be consistent with string_copying.7

Cc: Martin Sebor <msebor@redhat.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostpncpy.3, strncpy.3: Document in a single page
Alejandro Colomar [Wed, 14 Dec 2022 20:06:26 +0000 (21:06 +0100)] 
stpncpy.3, strncpy.3: Document in a single page

Rewrite to be consistent with the new string_copying.7 page.

Cc: Martin Sebor <msebor@redhat.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostpcpy.3, strcpy.3, strcat.3: Document in a single page
Alejandro Colomar [Wed, 14 Dec 2022 19:11:11 +0000 (20:11 +0100)] 
stpcpy.3, strcpy.3, strcat.3: Document in a single page

Rewrite to be consistent with the new string_copying.7 page.

Cc: Martin Sebor <msebor@redhat.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostpecpy.3, stpecpyx.3, ustpcpy.3, ustr2stp.3, zustr2stp.3, zustr2ustp.3: Add new...
Alejandro Colomar [Mon, 12 Dec 2022 14:17:28 +0000 (15:17 +0100)] 
stpecpy.3, stpecpyx.3, ustpcpy.3, ustr2stp.3, zustr2stp.3, zustr2ustp.3: Add new links to string_copying(7)

Cc: Martin Sebor <msebor@redhat.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring_copying.7: Add page to document all string-copying functions
Alejandro Colomar [Mon, 12 Dec 2022 00:20:55 +0000 (01:20 +0100)] 
string_copying.7: Add page to document all string-copying functions

This is an opportunity to use consistent language across the
documentation for all string-copying functions.

It is also easier to show the similarities and differences between all
of the functions, so that a reader can use this page to know which
function is needed for a given task.

Alternative functions not provided by libc have been given in the same
page, with reference implementations.

Cc: Martin Sebor <msebor@redhat.com>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Cc: Jakub Wilk <jwilk@jwilk.net>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Cc: Andrew Pinski <pinskia@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agolint-man.mk: Fix bogus stderr redirection
Alejandro Colomar [Sat, 17 Dec 2022 13:27:52 +0000 (14:27 +0100)] 
lint-man.mk: Fix bogus stderr redirection

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoutmp.5: STANDARDS: Specify that it's an XSI extension
Alejandro Colomar [Fri, 16 Dec 2022 18:39:45 +0000 (19:39 +0100)] 
utmp.5: STANDARDS: Specify that it's an XSI extension

Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoMany pages: Add '\" t' comment where necessary
Alejandro Colomar [Wed, 9 Nov 2022 15:36:36 +0000 (16:36 +0100)] 
Many pages: Add '\" t' comment where necessary

Scripted change:

$ grep -l -x '^[.]TS$' man*/* | sort -u | xargs sed -i -e "1i'\\\\\" t"

Link: <https://lore.kernel.org/linux-man/07a7d4e7-79a6-b2c3-6892-1e39a0679f27@gmail.com/T/#mcf36c8a387fd5ff4f800dc220e3dbdd229b556bd>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoINSTALL, Makefile, cmd.mk, lint-man.mk: Lint about '\" t' comment for tbl(1)
Alejandro Colomar [Wed, 9 Nov 2022 15:01:05 +0000 (16:01 +0100)] 
INSTALL, Makefile, cmd.mk, lint-man.mk: Lint about '\" t' comment for tbl(1)

This is to make sure that we have correct \" t comments in the pages,
which are necessary for the Debian package checker:

On 8/19/22 22:21, Jakub Wilk wrote:
> * Michael Kerrisk <mtk.manpages@gmail.com>, 2020-07-24 12:13:
>> For 15 years or at least, I've not paid any attention to adding the
>> 't' comments when I added tables to pages, and I do recall anyone
>> reporting ill effects.  So, I'm inclined to apply Mike's patch, but
>> will hold off a moment, in case there's other feedback.
>
> I'm a bit late, but...
>
> Lintian, the Debian package checker, sets the MANROFFSEQ environment
> variable to empty string as a speed optimization.  This turns off
> loading preprocessors that weren't explicitly declared in the source.
> The lack of '\" comments can cause false positives (and maybe also
> false negatives?) in Lintian.
>
> The use of $MANROFFSEQ for Lintian was proposed here:
> https://bugs.debian.org/677874
>
> Beware that the man(1) man page does not correctly explain what
> $MANROFFSEQ does: <https://bugs.debian.org/971009>

Also update the dependencies list, since now we also need head(1) and
tail(1) for linting man(7) source.

Link: <https://lore.kernel.org/linux-man/07a7d4e7-79a6-b2c3-6892-1e39a0679f27@gmail.com/T/#mcf36c8a387fd5ff4f800dc220e3dbdd229b556bd>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoman-pages.7: tfix
Eric Biggers [Thu, 15 Dec 2022 06:56:30 +0000 (22:56 -0800)] 
man-pages.7: tfix

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoioctl_userfaultfd.2: tfix
Eric Biggers [Thu, 15 Dec 2022 06:59:58 +0000 (22:59 -0800)] 
ioctl_userfaultfd.2: tfix

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoINSTALL: tfix
Eric Biggers [Thu, 15 Dec 2022 06:58:16 +0000 (22:58 -0800)] 
INSTALL: tfix

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoutimensat.2: tfix
Jakub Wilk [Thu, 15 Dec 2022 07:42:15 +0000 (08:42 +0100)] 
utimensat.2: tfix

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocopy_file_range.2: wfix
Alejandro Colomar [Tue, 13 Dec 2022 23:16:58 +0000 (00:16 +0100)] 
copy_file_range.2: wfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocopy_file_range.2: Fix wrong kernel version information
Amir Goldstein [Tue, 13 Dec 2022 12:08:34 +0000 (14:08 +0200)] 
copy_file_range.2: Fix wrong kernel version information

commit d7ba612d0 ("copy_file_range.2: Update cross-filesystem support
for 5.12") prematurely documented kernel 5.12 as the version that
changes the cross-fs copy_file_range() behavior, but that behavior
change was only merged in kernel version 5.19.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoscanf.3: Do not mention the ERANGE error
Ian Abbott [Thu, 8 Dec 2022 12:34:54 +0000 (12:34 +0000)] 
scanf.3: Do not mention the ERANGE error

The `scanf()` function does not intentionally set `errno` to `ERANGE`.
That is just a side effect of the code that it uses to perform
conversions.  It also does not work as reliably as indicated in the
'man' page when the target integer type is narrower than `long`.
Typically (at least in glibc) for target integer types narrower than
`long`, the number has to exceed the range of `long` (for signed
conversions) or `unsigned long` (for unsigned conversions) for `errno`
to be set to `ERANGE`.

Documenting `ERANGE` in the ERRORS section kind of implies that
`scanf()` should return `EOF` when an integer overflow is encountered,
which it doesn't (and doing so would violate the C standard).

Just remove any mention of the `ERANGE` error to avoid confusion.

Fixes: 646af540e467 ("Add an ERRORS section documenting at least some of the errors that may occur for scanf().")
Link: <https://lore.kernel.org/linux-man/5af4f708-337f-fddf-9a2d-e0e4602d3a72@mev.co.uk/T/#m900a1b1741afefab008a69e6b76919cd94aa81ef>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Zack Weinberg <zack@owlfolio.org>
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoscanf.3: Deprecate unsafe conversion specifiers
Alejandro Colomar [Mon, 12 Dec 2022 11:25:01 +0000 (12:25 +0100)] 
scanf.3: Deprecate unsafe conversion specifiers

Use of numeric conversion specifiers can produce Undefined Behvaior
under conditions that the program doesn't control; therefore, there's no
way to use them safely.

Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Zack Weinberg <zack@owlfolio.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocore.5: Clarify that RLIMIT_CORE is ignored when piping.
Alejandro Colomar [Sun, 11 Dec 2022 17:24:55 +0000 (18:24 +0100)] 
core.5: Clarify that RLIMIT_CORE is ignored when piping.

Reported-by: Luca Versari <veluca93@gmail.com>
Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=216648>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agointro.3: Document subsections of man3
Alejandro Colomar [Sun, 11 Dec 2022 17:17:00 +0000 (18:17 +0100)] 
intro.3: Document subsections of man3

Cowritten-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: Ingo Schwarze <schwarze@openbsd.org>
Cc: Douglas McIlroy <douglas.mcilroy@dartmouth.edu>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoshm_open.3: tfix
Alejandro Colomar [Sun, 11 Dec 2022 17:24:55 +0000 (18:24 +0100)] 
shm_open.3: tfix

Reported-by: 1092615079 <1092615079@qq.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agosocket.7: Be explicit that accept(2) respects SO_*TIMEO
Alejandro Colomar [Sun, 11 Dec 2022 14:00:30 +0000 (15:00 +0100)] 
socket.7: Be explicit that accept(2) respects SO_*TIMEO

See the previous commit.

Reported-by: Luis Javier Merino <ninjalj@gmail.com>
Cc: Tycho Andersen <tycho@tycho.pizza>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agosocket.7: be explicit that connect(2) respects SO_*TIMEO
Tycho Andersen [Mon, 28 Nov 2022 20:58:37 +0000 (13:58 -0700)] 
socket.7: be explicit that connect(2) respects SO_*TIMEO

Our group recently had some confusion around this. Although f327722042df
("socket.7: Explain effect of SO_SNDTIMEO for connect()") adds a mention of
connect(2), the wording around "Timeouts  only  have  effect  for  system
calls  that perform socket I/O" is slightly confusing: is connect(2) I/O?.
Let's just add connect(2) to the list of things that time out explicitly to
avoid any confusion.

Test program for grins:

 #include <stdio.h>
 #include <sys/socket.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>

int main(void)
{
struct sockaddr_in servaddr = {
                /* tycho.pizza */
                .sin_addr.s_addr = inet_addr("192.241.255.151"),
                .sin_port = htons(443),
                .sin_family = AF_INET,
        };
int fd;
struct timeval timeout = {
.tv_sec = 0,
.tv_usec = 100,
};

fd = socket(AF_INET, SOCK_STREAM, 0);
if (fd < 0) {
perror("socket");
return 1;
}

if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)) < 0) {
perror("setsockopt");
return 1;
}

if (connect(fd, (struct sockaddr *)&servaddr, sizeof(servaddr)) < 0) {
perror("connect");
return 1;
}

printf("connect successful\n");
return 0;
}

$ ./so_sndtimeo
connect: Operation now in progress

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostpncpy.3, strncpy.3: wfix
Alejandro Colomar [Tue, 6 Dec 2022 18:16:33 +0000 (19:16 +0100)] 
stpncpy.3, strncpy.3: wfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncat.3: Overrunning the dest buffer is not that bad
Alejandro Colomar [Tue, 6 Dec 2022 17:58:37 +0000 (18:58 +0100)] 
strncat.3: Overrunning the dest buffer is not that bad

With the right function call, that is, one that always copies the same
amount of bytes, and is so simple that can be inlined, the behavior
will be consistent enough to be warned by the compiler in most cases of
overrun, and crash quite consistently in the remaining.

Prefer simplicity over correctness, so suggest the simpler ustr2stp().

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring.3, strncat.3: Undeprecate strncat(3)
Alejandro Colomar [Tue, 6 Dec 2022 16:59:26 +0000 (17:59 +0100)] 
string.3, strncat.3: Undeprecate strncat(3)

After some investigation, I found a case where this function is useful:
Concatenating an unterminated string into a string.  It's not an ideal
API for that, but there's no other API that does it.

The closest thing, and something that some projects use instead of
strncat(3), is calling mempcpy(3) directly.  However mempcpy(3) isn't
ideal either (it's faster; just that).  It even requires a multiline
pattern to use correctly, which is a source of bugs.

So, suggest using a custom alternative that needs to be defined by the
programmer, which handles all the subtle details much better than any
of the conventional functions: ustr2stpe().

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring.3, strncat.3: Fix typo in prototype of strncat(3)
Alejandro Colomar [Tue, 6 Dec 2022 13:48:57 +0000 (14:48 +0100)] 
string.3, strncat.3: Fix typo in prototype of strncat(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostring.3: strncpy(3), strncat(3): Obsolete, and fix
Alejandro Colomar [Tue, 6 Dec 2022 01:16:50 +0000 (02:16 +0100)] 
string.3: strncpy(3), strncat(3): Obsolete, and fix

The prototype for strncat(3) was wrong.  Fix it.
Mark the functions as obsolete.
Fix the descriptions, to remove misleading text.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncat.3: tfix
Alejandro Colomar [Tue, 6 Dec 2022 01:15:24 +0000 (02:15 +0100)] 
strncat.3: tfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncat.3: BUGS: Truncation
Alejandro Colomar [Mon, 5 Dec 2022 22:16:38 +0000 (23:16 +0100)] 
strncat.3: BUGS: Truncation

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrcat.3, strncat.3: RIP strncat(3)
Alejandro Colomar [Mon, 5 Dec 2022 15:46:44 +0000 (16:46 +0100)] 
strcat.3, strncat.3: RIP strncat(3)

Never use this function.  Really.

Cc: <pkg-shadow-devel@alioth-lists.debian.net>
Cc: <libc-alpha@sourceware.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrcat.3: SYNOPSIS: Fix the size of 'dest'
Alejandro Colomar [Mon, 5 Dec 2022 15:09:47 +0000 (16:09 +0100)] 
strcat.3: SYNOPSIS: Fix the size of 'dest'

I had a mistake when adding VLA syntax to this prototype.  From this
fixed prototype, it's visible how broken the design for this function
is.  Next move is to kill this function.

Cc: <libc-alpha@sourceware.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostpncpy.3: Clarify what this function is for
Alejandro Colomar [Mon, 5 Dec 2022 14:04:12 +0000 (15:04 +0100)] 
stpncpy.3: Clarify what this function is for

Use concise wording to make the points more direct.
This function is rarely used for its only valid purpose.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agofilesystems.5: Don't refer to dead software; use a more generic term
Alejandro Colomar [Mon, 5 Dec 2022 13:15:32 +0000 (14:15 +0100)] 
filesystems.5: Don't refer to dead software; use a more generic term

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: Rename CAVEATS to BUGS
Alejandro Colomar [Sun, 4 Dec 2022 23:46:35 +0000 (00:46 +0100)] 
strncpy.3: Rename CAVEATS to BUGS

Those are not caveats, but actual bugs.  This function was misdesigned.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: wfix
Alejandro Colomar [Sun, 4 Dec 2022 23:42:49 +0000 (00:42 +0100)] 
strncpy.3: wfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: NAME: Clarify what this function is
Alejandro Colomar [Sun, 4 Dec 2022 23:08:52 +0000 (00:08 +0100)] 
strncpy.3: NAME: Clarify what this function is

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: SEE ALSO: Remove some references
Alejandro Colomar [Sun, 4 Dec 2022 23:06:11 +0000 (00:06 +0100)] 
strncpy.3: SEE ALSO: Remove some references

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: Deprecate strncpy(3) in favor of stpncpy(3)
Alejandro Colomar [Sun, 4 Dec 2022 23:05:15 +0000 (00:05 +0100)] 
strncpy.3: Deprecate strncpy(3) in favor of stpncpy(3)

It is equivalent, but reports truncation.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: Move description of valid use up
Alejandro Colomar [Sun, 4 Dec 2022 22:53:06 +0000 (23:53 +0100)] 
strncpy.3: Move description of valid use up

To make it more visible; and refer CAVEATS to still discourage its use.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: CAVEATS: It can't detect truncation
Alejandro Colomar [Sun, 4 Dec 2022 22:49:08 +0000 (23:49 +0100)] 
strncpy.3: CAVEATS: It can't detect truncation

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: ffix
Alejandro Colomar [Sun, 4 Dec 2022 22:40:34 +0000 (23:40 +0100)] 
strncpy.3: ffix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrncpy.3: Fix TH, and add myself to copyright
Alejandro Colomar [Sun, 4 Dec 2022 22:17:54 +0000 (23:17 +0100)] 
strncpy.3: Fix TH, and add myself to copyright

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agostrcpy.3, strncpy.3: Split the page and document them separately
Alejandro Colomar [Sun, 4 Dec 2022 22:14:48 +0000 (23:14 +0100)] 
strcpy.3, strncpy.3: Split the page and document them separately

strncpy(3) is completely unrelated to strcpy(3).  Rewrite its
documentation to be more explicit about this.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agopath_resolution.7: ffix
Alejandro Colomar [Sun, 4 Dec 2022 21:18:21 +0000 (22:18 +0100)] 
path_resolution.7: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocredentials.7: tfix
Alejandro Colomar [Sun, 4 Dec 2022 21:00:09 +0000 (22:00 +0100)] 
credentials.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocredentials.7: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:59:10 +0000 (21:59 +0100)] 
credentials.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoconsole_codes.4: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:57:25 +0000 (21:57 +0100)] 
console_codes.4: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agocpow.3: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:56:21 +0000 (21:56 +0100)] 
cpow.3: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoconnect.2: ffix
Alejandro Colomar [Sun, 4 Dec 2022 20:55:07 +0000 (21:55 +0100)] 
connect.2: ffix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoconnect.2: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:54:30 +0000 (21:54 +0100)] 
connect.2: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agowcsspn.3: NAME: Fix summary-description
Alejandro Colomar [Sun, 4 Dec 2022 20:50:43 +0000 (21:50 +0100)] 
wcsspn.3: NAME: Fix summary-description

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agowavelan.4: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:21:45 +0000 (21:21 +0100)] 
wavelan.4: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agouts_namespaces.7: wfix
Alejandro Colomar [Sun, 4 Dec 2022 20:21:01 +0000 (21:21 +0100)] 
uts_namespaces.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agouser_namespaces.7: Add missing word
Alejandro Colomar [Sun, 4 Dec 2022 20:19:09 +0000 (21:19 +0100)] 
user_namespaces.7: Add missing word

Cc: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agouser_namespaces.7: ffix
Alejandro Colomar [Sun, 4 Dec 2022 20:15:24 +0000 (21:15 +0100)] 
user_namespaces.7: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agouser_namespaces.7: wfix
Alejandro Colomar [Sun, 4 Dec 2022 20:14:29 +0000 (21:14 +0100)] 
user_namespaces.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agotowctrans.3: wfix
Alejandro Colomar [Sun, 4 Dec 2022 20:11:32 +0000 (21:11 +0100)] 
towctrans.3: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agottytype.5: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:10:27 +0000 (21:10 +0100)] 
ttytype.5: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agotime_namespaces.7: tfix
Alejandro Colomar [Sun, 4 Dec 2022 20:04:24 +0000 (21:04 +0100)] 
time_namespaces.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agosymlink.2: tfix
Alejandro Colomar [Sun, 4 Dec 2022 19:57:54 +0000 (20:57 +0100)] 
symlink.2: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoproc.5: tfix
Alejandro Colomar [Sun, 4 Dec 2022 19:51:42 +0000 (20:51 +0100)] 
proc.5: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoMany pages: wfix
Alejandro Colomar [Sun, 4 Dec 2022 19:38:06 +0000 (20:38 +0100)] 
Many pages: wfix

Refer consistently to software versions.  In most cases, it is done as
<software> <version>.  In the case of Linux and glibc, use the project
name, instead of other terms such as 'kernel' or 'library'.

I found the uses of inconsistent language with the following:

$ find man* -type f \
| xargs grep -i '\(since\|before\|after\|until\|to\|from\|in\|between\|version\|with\) \(kernel\|version\|2\.\|3\.\|4\.\|5\.\)' \
| sort

However, I might have missed some cases.  Anyway, 99% consistency is
pretty good consistency.  We'll fix the remaining cases as we see them.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agopasswd.5: ffix
Alejandro Colomar [Sun, 4 Dec 2022 12:43:30 +0000 (13:43 +0100)] 
passwd.5: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agonetwork_namespaces.7: wfix
Alejandro Colomar [Sun, 4 Dec 2022 12:36:16 +0000 (13:36 +0100)] 
network_namespaces.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agomount_namespaces.7: tfix
Alejandro Colomar [Sun, 4 Dec 2022 12:29:30 +0000 (13:29 +0100)] 
mount_namespaces.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agomq_close.3: tfix
Alejandro Colomar [Sun, 4 Dec 2022 12:27:48 +0000 (13:27 +0100)] 
mq_close.3: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agomalloc.3: ffix
Alejandro Colomar [Sun, 4 Dec 2022 12:23:08 +0000 (13:23 +0100)] 
malloc.3: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agomount_namespaces.7: ffix
Alejandro Colomar [Sun, 4 Dec 2022 12:12:38 +0000 (13:12 +0100)] 
mount_namespaces.7: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agomount_namespaces.7: tfix
Alejandro Colomar [Sun, 4 Dec 2022 12:10:49 +0000 (13:10 +0100)] 
mount_namespaces.7: tfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agokeyrings.7: wfix
Alejandro Colomar [Sun, 4 Dec 2022 11:49:03 +0000 (12:49 +0100)] 
keyrings.7: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoiswctype.3: wfix
Alejandro Colomar [Sun, 4 Dec 2022 11:44:03 +0000 (12:44 +0100)] 
iswctype.3: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agofilesystems.5: wfix
Alejandro Colomar [Sun, 4 Dec 2022 11:35:01 +0000 (12:35 +0100)] 
filesystems.5: wfix

ext2 is not a high performance fs by today's standards.  And it's not
used in Linux by default.

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agoerrno.3: wfix
Alejandro Colomar [Sun, 4 Dec 2022 11:29:38 +0000 (12:29 +0100)] 
errno.3: wfix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 years agodsp56k.4: ffix
Alejandro Colomar [Sun, 4 Dec 2022 11:20:44 +0000 (12:20 +0100)] 
dsp56k.4: ffix

Reported-by: Helge Kreutzmann <debian@helgefjell.de>
Cc: Mario Blättermann <mario.blaettermann@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>