]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
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>
11 months agokeyctl.2, KEYCTL_DH_COMPUTE.2const: Split KEYCTL_DH_COMPUTE from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 23:09:32 +0000 (01:09 +0200)] 
keyctl.2, KEYCTL_DH_COMPUTE.2const: Split KEYCTL_DH_COMPUTE from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_GET_PERSISTENT.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 22:52:20 +0000 (00:52 +0200)] 
KEYCTL_GET_PERSISTENT.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_GET_PERSISTENT.2const: Split KEYCTL_GET_PERSISTENT from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 22:47:36 +0000 (00:47 +0200)] 
keyctl.2, KEYCTL_GET_PERSISTENT.2const: Split KEYCTL_GET_PERSISTENT from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_INVALIDATE.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 20:13:12 +0000 (22:13 +0200)] 
KEYCTL_INVALIDATE.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_INVALIDATE.2const: Split KEYCTL_INVALIDATE from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 20:09:26 +0000 (22:09 +0200)] 
keyctl.2, KEYCTL_INVALIDATE.2const: Split KEYCTL_INVALIDATE from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_SESSION_TO_PARENT.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 17:57:18 +0000 (19:57 +0200)] 
KEYCTL_SESSION_TO_PARENT.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_SESSION_TO_PARENT.2const: Split KEYCTL_SESSION_TO_PARENT from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 17:43:06 +0000 (19:43 +0200)] 
keyctl.2, KEYCTL_SESSION_TO_PARENT.2const: Split KEYCTL_SESSION_TO_PARENT from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_GET_SECURITY.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 17:18:39 +0000 (19:18 +0200)] 
KEYCTL_GET_SECURITY.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_GET_SECURITY.2const: Split KEYCTL_GET_SECURITY from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 17:12:37 +0000 (19:12 +0200)] 
keyctl.2, KEYCTL_GET_SECURITY.2const: Split KEYCTL_GET_SECURITY from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_ASSUME_AUTHORITY.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 14:23:37 +0000 (16:23 +0200)] 
KEYCTL_ASSUME_AUTHORITY.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_ASSUME_AUTHORITY.2const: Split KEYCTL_ASSUME_AUTHORITY from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 14:19:49 +0000 (16:19 +0200)] 
keyctl.2, KEYCTL_ASSUME_AUTHORITY.2const: Split KEYCTL_ASSUME_AUTHORITY from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_SET_TIMEOUT.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 14:29:57 +0000 (16:29 +0200)] 
KEYCTL_SET_TIMEOUT.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_SET_TIMEOUT.2const: Split KEYCTL_SET_TIMEOUT from keyctl(2)
Alejandro Colomar [Sat, 17 Aug 2024 13:57:42 +0000 (15:57 +0200)] 
keyctl.2, KEYCTL_SET_TIMEOUT.2const: Split KEYCTL_SET_TIMEOUT from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_SET_REQKEY_KEYRING.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 12:50:15 +0000 (14:50 +0200)] 
KEYCTL_SET_REQKEY_KEYRING.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_SET_REQKEY_KEYRING.2const: Split KEYCTL_SET_REQKEY_KEYRING from...
Alejandro Colomar [Sat, 17 Aug 2024 12:30:17 +0000 (14:30 +0200)] 
keyctl.2, KEYCTL_SET_REQKEY_KEYRING.2const: Split KEYCTL_SET_REQKEY_KEYRING from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_INSTANTIATE.2const: Tweak after split
Alejandro Colomar [Sat, 17 Aug 2024 12:13:15 +0000 (14:13 +0200)] 
KEYCTL_INSTANTIATE.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_INSTANTIATE.2const, KEYCTL_INSTANTIATE_IOV.2const, KEYCTL_NEGATE...
Alejandro Colomar [Sat, 17 Aug 2024 11:25:32 +0000 (13:25 +0200)] 
keyctl.2, KEYCTL_INSTANTIATE.2const, KEYCTL_INSTANTIATE_IOV.2const, KEYCTL_NEGATE.2const, KEYCTL_REJECT.2const: Split KEYCTL_INSTANTIATE*, KEYCTL_NEGATE, KEYCTL_REJECT from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_READ.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 23:32:54 +0000 (01:32 +0200)] 
KEYCTL_READ.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_READ.2const: Split KEYCTL_READ from keyctl(2)
Alejandro Colomar [Wed, 10 Jul 2024 23:23:39 +0000 (01:23 +0200)] 
keyctl.2, KEYCTL_READ.2const: Split KEYCTL_READ from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_SEARCH.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 23:10:12 +0000 (01:10 +0200)] 
KEYCTL_SEARCH.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_SEARCH.2const: Split KEYCTL_SEARCH from keyctl(2)
Alejandro Colomar [Wed, 10 Jul 2024 22:58:56 +0000 (00:58 +0200)] 
keyctl.2, KEYCTL_SEARCH.2const: Split KEYCTL_SEARCH from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_UNLINK.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 22:48:47 +0000 (00:48 +0200)] 
KEYCTL_UNLINK.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_UNLINK.2const: Split KEYCTL_UNLINK from keyctl(2)
Alejandro Colomar [Wed, 10 Jul 2024 22:45:24 +0000 (00:45 +0200)] 
keyctl.2, KEYCTL_UNLINK.2const: Split KEYCTL_UNLINK from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_LINK.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 22:28:01 +0000 (00:28 +0200)] 
KEYCTL_LINK.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_LINK.2const: Split KEYCTL_LINK from keyctl(2)
Alejandro Colomar [Wed, 10 Jul 2024 22:23:55 +0000 (00:23 +0200)] 
keyctl.2, KEYCTL_LINK.2const: Split KEYCTL_LINK from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_CLEAR.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 22:13:43 +0000 (00:13 +0200)] 
KEYCTL_CLEAR.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_CLEAR.2const: Split KEYCTL_CLEAR from keyctl(2)
Alejandro Colomar [Wed, 10 Jul 2024 22:11:27 +0000 (00:11 +0200)] 
keyctl.2, KEYCTL_CLEAR.2const: Split KEYCTL_CLEAR from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_DESCRIBE.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 20:42:59 +0000 (22:42 +0200)] 
KEYCTL_DESCRIBE.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_DESCRIBE.2const: Split KEYCTL_DESCRIBE from keyctl(2)
Alejandro Colomar [Wed, 10 Jul 2024 20:32:47 +0000 (22:32 +0200)] 
keyctl.2, KEYCTL_DESCRIBE.2const: Split KEYCTL_DESCRIBE from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_SETPERM.2const: Tweak after split
Alejandro Colomar [Wed, 10 Jul 2024 20:15:25 +0000 (22:15 +0200)] 
KEYCTL_SETPERM.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_SETPERM.2const: Split KEYCTL_SETPERM from keyctl(2)
Alejandro Colomar [Wed, 3 Jul 2024 15:31:27 +0000 (17:31 +0200)] 
keyctl.2, KEYCTL_SETPERM.2const: Split KEYCTL_SETPERM from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_CHOWN.2const: Tweak after split
Alejandro Colomar [Wed, 3 Jul 2024 14:59:54 +0000 (16:59 +0200)] 
KEYCTL_CHOWN.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_CHOWN.2const: Split KEYCTL_CHOWN from keyctl(2)
Alejandro Colomar [Wed, 3 Jul 2024 14:54:35 +0000 (16:54 +0200)] 
keyctl.2, KEYCTL_CHOWN.2const: Split KEYCTL_CHOWN from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_REVOKE.2const: Tweak after split
Alejandro Colomar [Wed, 3 Jul 2024 13:54:53 +0000 (15:54 +0200)] 
KEYCTL_REVOKE.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_REVOKE.2const: Split KEYCTL_REVOKE from keyctl(2)
Alejandro Colomar [Wed, 3 Jul 2024 13:51:16 +0000 (15:51 +0200)] 
keyctl.2, KEYCTL_REVOKE.2const: Split KEYCTL_REVOKE from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_UPDATE.2const: Tweak after split
Alejandro Colomar [Wed, 3 Jul 2024 13:45:36 +0000 (15:45 +0200)] 
KEYCTL_UPDATE.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_UPDATE.2const: Split KEYCTL_UPDATE from keyctl(2)
Alejandro Colomar [Mon, 1 Jul 2024 13:11:15 +0000 (15:11 +0200)] 
keyctl.2, KEYCTL_UPDATE.2const: Split KEYCTL_UPDATE from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_JOIN_SESSION_KEYRING.2const: Tweak after split
Alejandro Colomar [Mon, 1 Jul 2024 12:46:07 +0000 (14:46 +0200)] 
KEYCTL_JOIN_SESSION_KEYRING.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_JOIN_SESSION_KEYRING.2const: Split KEYCTL_JOIN_SESSION_KEYRING from...
Alejandro Colomar [Mon, 1 Jul 2024 11:23:42 +0000 (13:23 +0200)] 
keyctl.2, KEYCTL_JOIN_SESSION_KEYRING.2const: Split KEYCTL_JOIN_SESSION_KEYRING from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoKEYCTL_GET_KEYRING_ID.2const: Tweak after split
Alejandro Colomar [Wed, 19 Jun 2024 10:50:52 +0000 (12:50 +0200)] 
KEYCTL_GET_KEYRING_ID.2const: Tweak after split

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2, KEYCTL_GET_KEYRING_ID.2const: Split KEYCTL_GET_KEYRING_ID from keyctl(2)
Alejandro Colomar [Wed, 19 Jun 2024 10:41:39 +0000 (12:41 +0200)] 
keyctl.2, KEYCTL_GET_KEYRING_ID.2const: Split KEYCTL_GET_KEYRING_ID from keyctl(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agokeyctl.2: Tweak in preparation for sashimi
Alejandro Colomar [Wed, 19 Jun 2024 10:01:02 +0000 (12:01 +0200)] 
keyctl.2: Tweak in preparation for sashimi

Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agobdflush.2, syscalls.2: bdflush was removed
наб [Fri, 16 Aug 2024 22:35:27 +0000 (00:35 +0200)] 
bdflush.2, syscalls.2: bdflush was removed

There's no point documenting this syscall at any point in time,
because it changed constantly. A post-mortem summary I believe to be
comprehensive is included below.

The #include <sys/kdaemon.h> was removed in glibc 2.23:
    commit eed3e1eb79bcfa9b52609fd875fa2d522e2d6bce
    Author: Joseph Myers <joseph@codesourcery.com>
    Date:   Mon Dec 14 22:52:15 2015 +0000

    Make obsolete syscall wrappers into compat symbols (bug 18472).

    * bdflush: in Linux 2.6, does nothing if present.

    [...]
    generated for such aliases.  Those five syscalls are then made into
    compat symbols (obsoleted in glibc 2.23, so future ports won't have
    these symbols at all), with the header <sys/kdaemon.h> declaring
    bdflush being removed.  When we move to 3.2 as minimum kernel version,
    the same can be done for nfsservctl (removed in Linux 3.1) as well.
    [...]

Appears in 1.1.3
(func=0  turns the calling process into the bdflush daemon,
 func=1  return sync_old_buffers();,
 func>=2 is parameters):
    Author: Linus Torvalds <torvalds@linuxfoundation.org>
        Import 1.1.3

    +/* This is the interface to bdflush.  As we get more sophisticated, we can
    + * pass tuning parameters to this "process", to adjust how it behaves.  If you
    + * invoke this again after you have done this once, you would simply modify
    + * the tuning parameters.  We would want to verify each parameter, however,
    + * to make sure that it is reasonable. */
    +
    +asmlinkage int sys_bdflush(int func, int data)
    +{

bdflush() is just a kernel thread, and func 0 is just return 0; since 1.3.50:
    Author: Linus Torvalds <torvalds@linuxfoundation.org>
        Import 1.3.50

    -       /* Basically func 0 means start, 1 means read param 1, 2 means write param 1, etc */
    +       /* Basically func 1 means read param 1, 2 means write param 1, etc */
            if (func >= 2) {
                    i = (func-2) >> 1;
                    if (i < 0 || i >= N_PARAM)
    @@ -1930,13 +1845,32 @@ asmlinkage int sys_bdflush(int func, long data)
                    bdf_prm.data[i] = data;
                    return 0;
            };
    +
    +       /* Having func 0 used to launch the actual bdflush and then never
    +       return (unless explicitly killed). We return zero here to
    +       remain semi-compatible with present update(8) programs. */
    +
    +       return 0;
    +}
    +
    +/* This is the actual bdflush daemon itself. It used to be started from
    + * the syscall above, but now we launch it ourselves internally with
    + * kernel_thread(...)  directly after the first thread in init/main.c */
    +
    +int bdflush(void * unused) {

func 1 is actually exit(0) since 2.3.23pre1:
    Author: Linus Torvalds <torvalds@linuxfoundation.org>
        Import 2.3.23pre1

                if (func == 1) {
    +               /* do_exit directly and let kupdate to do its work alone. */
    +               do_exit(0);
    +#if 0 /* left here as it's the only example of lazy-mm-stuff used from
    +        a syscall that doesn't care about the current mm context. */

fund!=0 is a return 0 since 2.5.12:
    Author: Andrew Morton <akpm@zip.com.au>
    Date:   Mon Apr 29 23:52:10 2002 -0700

        [PATCH] writeback from address spaces

        [ I reversed the order in which writeback walks the superblock's
          dirty inodes.  It sped up dbench's unlink phase greatly.  I'm
          such a sleaze ]

        The core writeback patch.  Switches file writeback from the dirty
        buffer LRU over to address_space.dirty_pages.

        - The buffer LRU is removed

        - The buffer hash is removed (uses blockdev pagecache lookups)

        - The bdflush and kupdate functions are implemented against
          address_spaces, via pdflush.

        [...]

Deprecated since 2.5.52:
    Author: Andrew Morton <akpm@digeo.com>
    Date:   Sat Dec 14 03:16:29 2002 -0800

        [PATCH] deprecate use of bdflush()

        Patch from Robert Love <rml@tech9.net>

        We can never get rid of it if we do not deprecate it - so do so and
        print a stern warning to those who still run bdflush daemons.

Removed outright in 5.15-rc1:
    commit b48c7236b13cb5ef1b5fdf744aa8841df0f7b43a
    Author: Eric W. Biederman <ebiederm@xmission.com>
    Date:   Tue Jun 29 15:11:44 2021 -0500

        exit/bdflush: Remove the deprecated bdflush system call

        The bdflush system call has been deprecated for a very long time.
        Recently Michael Schmitz tested[1] and found that the last known
        caller of of the bdflush system call is unaffected by it's removal.

        Since the code is not needed delete it.

        [1] https://lkml.kernel.org/r/36123b5d-daa0-6c2b-f2d4-a942f069fd54@gmail.com

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Message-ID: <ynknns52cczu2bxtazbmub3xxe62a2hajkod2qephnby5dqt7o@tarta.nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agouretprobe.2: Add page
Jiri Olsa [Tue, 11 Jun 2024 11:21:58 +0000 (13:21 +0200)] 
uretprobe.2: Add page

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Song Liu <songliubraving@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: John Fastabend <john.fastabend@gmail.com
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: "Edgecombe, Rick P" <rick.p.edgecombe@intel.com>
Cc: Deepak Gupta <debug@rivosinc.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Message-ID: <20240611112158.40795-10-jolsa@kernel.org>
[alx: minor tweaks]
Acked-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoregex.3: *preg is initialized with regcomp(), not regexec()
Dirk Gouders [Tue, 13 Aug 2024 18:49:51 +0000 (20:49 +0200)] 
regex.3: *preg is initialized with regcomp(), not regexec()

Fixes: 1838a55edd6c47cb ("regex.3: Desoupify regexec() description")
Signed-off-by: Dirk Gouders <dirk@gouders.net>
Message-ID: <20240813185011.3806-1-dirk@gouders.net>
Reviewed-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosyscalls.2: Expand the Notes column to the right margin
наб [Mon, 12 Aug 2024 17:22:20 +0000 (19:22 +0200)] 
syscalls.2: Expand the Notes column to the right margin

This prevents rows breaking when they could just go further to the right

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Message-ID: <qruxkxy2wtmmaohagimcanhyoyfvmtzn3zmbasxqsgn5tvjfgc@tarta.nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agofmod.3: Fix example
Alejandro Colomar [Fri, 16 Aug 2024 11:54:47 +0000 (13:54 +0200)] 
fmod.3: Fix example

Reported-by: Morten Welinder <mwelinder@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agonextup.3: wfix + tfix
Vincent Lefevre [Thu, 8 Aug 2024 11:56:10 +0000 (13:56 +0200)] 
nextup.3: wfix + tfix

The current "If x is 0" condition is a bit misleading because "is"
is not the equality test (just like when saying "x is NaN") and 0
as a FP number stands for +0, while this condition should apply to
both -0 and +0.
Replace this condition by "If x is +0 or -0".

Replace "Nan" by "NaN" (typography used everywhere else).

Cc: Dave Kemper <saint.snit@gmail.com>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Damian McGuckin <damianm@esi.com.au>
Cc: John Gardner <gardnerjohng@gmail.com>
Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
Message-ID: <20240808115610.GC2669@cventin.lip.ens-lyon.fr>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agosigaction.2: Improve wording and add an example in the BUGS section
Mikołaj Kołek [Wed, 7 Aug 2024 13:58:32 +0000 (15:58 +0200)] 
sigaction.2: Improve wording and add an example in the BUGS section

This patch clears up the wording of the first part of the BUGS section
of the sigaction(2) manual page.  Currently, it is very unclear when
exactly the bug can occur, and there is no example, which I aim to
fix. The text of the patch is partially based on the BUGS section of
the signal(2) manual page.

I also attach a C program that, when run on an x86 Linux computer,
shows that my example behaves like I say it does. The code runs the
int instruction for each value from 0 to 255 with all registers set to
0 to show that all fields of the siginfo_t besides si_signo and
si_code equal zero. The program is based on the attachment to bug
205831 on the kernel bugtracker which first dealt with this issue,
which you can find here:
<https://bugzilla.kernel.org/show_bug.cgi?id=205831>. This is the code
of the test program:

 #define CR "\n\t"
 #define _GNU_SOURCE 1

 #include <stdbool.h>
 #include <signal.h>
 #include <stdint.h>
 #include <stdio.h>

static siginfo_t  siginfo;

void
handler(int sig, siginfo_t *info, void *ucontext)
{
    ucontext_t     *uc = (ucontext_t*) ucontext;
    const uint8_t  *pc = (const uint8_t*) uc->uc_mcontext.gregs[REG_RIP];

    siginfo = *info;

    // skip the faulting instruction
    if(*pc == 0xCC || *pc == 0xF1)
        uc->uc_mcontext.gregs[REG_RIP] += 1;
    else if(*pc == 0xCD)
        uc->uc_mcontext.gregs[REG_RIP] += 2;
    else
        ; //assume the PC has already been advanced over the fault
}

static __attribute__((noinline)) void
call_int(unsigned char argument)
{
    asm volatile(
        "leaq 1f(%%rip), %%rcx"
        CR "addq   %%rcx, %%rax"
        CR "xor    %%rbx, %%rbx"
        CR "xor    %%rcx, %%rcx"
        CR "xor    %%rdx, %%rdx"
        CR "xor    %%rsi, %%rsi"
        CR "xor    %%rdi, %%rdi"
        CR "xor    %%rbp, %%rbp"
        CR "xor    %%r8, %%r8"
        CR "xor    %%r9, %%r8"
        CR "xor    %%r10, %%r10"
        CR "xor    %%r11, %%r11"
        CR "xor    %%r12, %%r12"
        CR "xor    %%r13, %%r13"
        CR "xor    %%r14, %%r14"
        CR "xor    %%r15, %%r15"
        CR "call   *%%rax"
        CR "jmp    2f"
        CR ".p2align 3"
        "\n1:"
        CR ".irp   i,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"
        CR ".irp   j,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15"
        CR "xor    %%rax, %%rax"
        CR ".byte  0xCD,(\\i*16 + \\j)"
        CR "ret"
        CR ".p2align 3"
        CR ".endr"
        CR ".endr"
        "\n2:"

        :
        : "a" (argument * 8)
        : "rbx", "rcx", "rdx", "rsi", "rdi",
          "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
    );
}

int
main(void)
{
    struct sigaction sa = { 0 };
    sa.sa_sigaction = &handler;
    sa.sa_flags = SA_SIGINFO | SA_RESTART;
    sigaction(SIGSEGV, &sa, 0);
    sigaction(SIGTRAP, &sa, 0);

    for(int i = 0; i < 256; i++) {
        call_int(i);

        bool others_zeroed = (
            siginfo.si_errno == 0 &&
            siginfo.si_pid == 0 &&
            siginfo.si_uid == 0 &&
            siginfo.si_status == 0 &&
            siginfo.si_utime == 0 &&
            siginfo.si_stime == 0 &&
            siginfo.si_value.sival_ptr == 0 &&
            siginfo.si_value.sival_int == 0 &&
            siginfo.si_int == 0 &&
            siginfo.si_ptr == 0 &&
            siginfo.si_overrun == 0 &&
            siginfo.si_timerid == 0 &&
            siginfo.si_addr == 0 &&
            siginfo.si_band == 0 &&
            siginfo.si_fd == 0 &&
            siginfo.si_addr_lsb == 0 &&
            siginfo.si_lower == 0 &&
            siginfo.si_upper == 0 &&
            siginfo.si_pkey == 0 &&
            siginfo.si_call_addr == 0 &&
            siginfo.si_syscall == 0 &&
            siginfo.si_arch == 0
        );

        printf("int $0x%02x: sig=%2d code=%04x others_zeroed=%i\n",
            i,
            siginfo.si_signo,
            siginfo.si_code,
            others_zeroed
        );
    }

    return 0;
}

Link: <https://bugzilla.kernel.org/show_bug.cgi?id=205831>
Cc: Zack Weinberg <zackw@panix.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Mikołaj Kołek <kolek.mikolaj@gmail.com>
Message-ID: <CAHGiy69OQ78x42+6iE7HqAiOaPCscn8fs=VNaxFMNSR7Q9R-mw@mail.gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agotzset.3: srcfix (semantic newlines)
Alejandro Colomar [Thu, 8 Aug 2024 08:09:13 +0000 (10:09 +0200)] 
tzset.3: srcfix (semantic newlines)

Reported-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agoepoll.7: Clarify the event distribution under edge-triggered mode
Andy Pan [Thu, 1 Aug 2024 11:38:38 +0000 (11:38 +0000)] 
epoll.7: Clarify the event distribution under edge-triggered mode

For the moment, the edge-triggered epoll generates an event for each
receipt of a chunk of data, that is to say, epoll_wait() will return
and tell us a monitored file descriptor is ready whenever there is a
new activity on that FD since we were last informed about that FD.
This is not a real _edge_ implementation for epoll, but it's been
working this way for years and plenty of projects are relying on it
to eliminate the overhead of one system call of read(2) per wakeup event.

There are several renowned open-source projects relying on this feature
for notification function (with eventfd): register eventfd with EPOLLET
and avoid calling read(2) on the eventfd when there is wakeup event (eventfd being written).
Examples: nginx [1], netty [2], tokio [3], libevent [4], ect. [5]
These projects are widely used in today's Internet infrastructures.
Thus, changing this behavior of epoll ET will fundamentally break them
and cause a significant negative impact.
Linux has changed it for pipe before [6], breaking some Android libraries,
which had got "reverted" somehow. [7] [8]

Nevertheless, the paragraph in the manual pages describing this
characteristic of epoll ET seems ambiguous, I think a more explict
sentence should be used to clarify it. We're improving the notification
mechanism for libuv recently by exploiting this feature with eventfd,
which brings us a significant performance boost. [9]

Therefore, we (as well as the maintainers of nginx, netty, tokio, etc.)
would have a sense of security to build an enhanced notification function
based on this feature if there is a guarantee of retaining this implementation
of epoll ET for the backward compatibility in the man pages.

[1]: https://github.com/nginx/nginx/blob/efc6a217b92985a1ee211b6bb7337cd2f62deb90/src/event/modules/ngx_epoll_module.c#L386-L457
[2]: https://github.com/netty/netty/pull/9192
[3]: https://github.com/tokio-rs/mio/blob/309daae21ecb1d46203a7dbc0cf4c80310240cba/src/sys/unix/waker.rs#L111-L143
[4]: https://github.com/libevent/libevent/blob/525f5d0a14c9c103be750f2ca175328c25505ea4/event.c#L2597-L2614
[5]: https://github.com/libuv/libuv/pull/4400#issuecomment-2123798748
[6]: https://lkml.iu.edu/hypermail/linux/kernel/2010.1/04363.html
[7]: https://github.com/torvalds/linux/commit/3a34b13a88caeb2800ab44a4918f230041b37dd9
[8]: https://github.com/torvalds/linux/commit/3b844826b6c6affa80755254da322b017358a2f4
[9]: https://github.com/libuv/libuv/pull/4400#issuecomment-2103232402

Signed-off-by: Andy Pan <i@andypan.me>
Cc: <linux-api@vger.kernel.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Message-ID: <20240801-epoll-et-desc-v5-1-7fcb9260a3b2@andypan.me>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolandlock.7: Document Landlock ABI version 5 (IOCTL)
Günther Noack [Tue, 23 Jul 2024 10:19:17 +0000 (10:19 +0000)] 
landlock.7: Document Landlock ABI version 5 (IOCTL)

Landlock ABI 5 restricts ioctl(2) on device files.

Closes: <https://github.com/landlock-lsm/linux/issues/39>
Reviewed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Günther Noack <gnoack@google.com>
Message-ID: <20240723101917.90918-3-gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
11 months agolandlock.7, landlock_*.2: Document Landlock ABI version 4
Günther Noack [Tue, 23 Jul 2024 10:19:16 +0000 (10:19 +0000)] 
landlock.7, landlock_*.2: Document Landlock ABI version 4

Landlock ABI 4 restricts bind(2) and connect(2) on TCP port numbers.

The intent is to bring the man pages mostly in line with the kernel
documentation again.  I intentionally did not add networking support to the
usage example in landlock.7 - I feel that in the long run, we would be better
advised to maintain longer example code in the kernel samples.

Closes: <https://github.com/landlock-lsm/linux/issues/32>
Reviewed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Günther Noack <gnoack@google.com>
Message-ID: <20240723101917.90918-2-gnoack@google.com>
Co-developed-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agosyscalls.2: srcfix (2/3)
G. Branden Robinson [Sat, 27 Jul 2024 19:27:52 +0000 (14:27 -0500)] 
syscalls.2: srcfix (2/3)

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-syscall-table-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: <20240727192752.hxxo4nl52qyskb2u@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agosyscalls.2: srcfix (1/3)
G. Branden Robinson [Sat, 27 Jul 2024 19:27:45 +0000 (14:27 -0500)] 
syscalls.2: srcfix (1/3)

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-syscall-table-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
/T{$/,/^T}/s/ \\fB\([a-z0-9_][a-z0-9_]*\)\\fP\(([0-9][a-z]*)\) /\
.BR \1 \2\
/

Signed-off-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Message-ID: <20240727192745.lt2oo34hw3limkls@illithid>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agomemccpy.3: Clarify that the delimiter is copied
Alejandro Colomar [Wed, 31 Jul 2024 10:21:33 +0000 (12:21 +0200)] 
memccpy.3: Clarify that the delimiter is copied

Reported-by: Keith Thompson <Keith.S.Thompson@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoio_submit.2: Document RWF_ATOMIC
John Garry [Mon, 22 Jul 2024 09:57:23 +0000 (09:57 +0000)] 
io_submit.2: Document RWF_ATOMIC

Document RWF_ATOMIC for asynchronous I/O.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Message-ID: <20240722095723.597846-4-john.g.garry@oracle.com>
[alx: wfix; ffix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoreadv.2: Document RWF_ATOMIC flag
Himanshu Madhani [Mon, 22 Jul 2024 09:57:22 +0000 (09:57 +0000)] 
readv.2: Document RWF_ATOMIC flag

Add RWF_ATOMIC flag description for pwritev2().

Signed-off-by: Himanshu Madhani <himanshu.madhani@oracle.com>
[jpg: complete rewrite]
Signed-off-by: John Garry <john.g.garry@oracle.com>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Message-ID: <20240722095723.597846-3-john.g.garry@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
[alx: semantic newlines; srcfix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agostatx.2: Document STATX_WRITE_ATOMIC
Himanshu Madhani [Mon, 22 Jul 2024 09:57:21 +0000 (09:57 +0000)] 
statx.2: Document STATX_WRITE_ATOMIC

Add the text to the statx man page.

Signed-off-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: John Garry <john.g.garry@oracle.com>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Message-ID: <20240722095723.597846-2-john.g.garry@oracle.com>
[alx: ffix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoman/: ffix
Alejandro Colomar [Tue, 23 Jul 2024 17:11:43 +0000 (19:11 +0200)] 
man/: ffix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agostrsep.3: Use CAVEATS instead of BUGS
Alejandro Colomar [Tue, 23 Jul 2024 16:58:22 +0000 (18:58 +0200)] 
strsep.3: Use CAVEATS instead of BUGS

These are not bugs at all.  It's a good API.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agostrsep.3: HISTORY: Relax portability concerns
Alejandro Colomar [Tue, 23 Jul 2024 16:40:34 +0000 (18:40 +0200)] 
strsep.3: HISTORY: Relax portability concerns

We already document that it's a BSD function, not in any standard.
No need to worry programmers much more than that.
We have STANDARDS for that.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agostrsep.3: STANDARDS: It's available in the BSDs (as it originated there)
Alejandro Colomar [Tue, 23 Jul 2024 16:39:45 +0000 (18:39 +0200)] 
strsep.3: STANDARDS: It's available in the BSDs (as it originated there)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolandlock_add_rule.2: ERRORS: Document missing reason for EINVAL
Günther Noack [Fri, 19 Jul 2024 13:38:00 +0000 (13:38 +0000)] 
landlock_add_rule.2: ERRORS: Document missing reason for EINVAL

This documents a missing reason for why EINVAL might be returned.
The documented behavior exists since the first version of Landlock.

Reviewed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Günther Noack <gnoack@google.com>
Message-ID: <20240719133801.3541732-5-gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolandlock_create_ruleset.2: Update docs for landlock_ruleset_attr
Günther Noack [Fri, 19 Jul 2024 13:37:59 +0000 (13:37 +0000)] 
landlock_create_ruleset.2: Update docs for landlock_ruleset_attr

This updates the documentation for struct landlock_ruleset_attr
in line with the changed kernel documentation (see link below).

Link: <https://lore.kernel.org/all/20240711165456.2148590-2-gnoack@google.com/>
Reviewed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Günther Noack <gnoack@google.com>
Message-ID: <20240719133801.3541732-4-gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolandlock.7, landlock_*.2: wfix
Günther Noack [Fri, 19 Jul 2024 13:37:58 +0000 (13:37 +0000)] 
landlock.7, landlock_*.2: wfix

* Various wording fixes
* List the same error code multiple times,
  if it can happen for multiple reasons.

Reviewed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Günther Noack <gnoack@google.com>
Message-ID: <20240719133801.3541732-3-gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agofanotify_init.2: Support for FA_* flags has been backported to LTS kernels
Chuck Lever [Sat, 13 Jul 2024 18:15:47 +0000 (14:15 -0400)] 
fanotify_init.2: Support for FA_* flags has been backported to LTS kernels

Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Message-ID: <20240713181548.38002-3-cel@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agofanotify.7: Document changes backported to LTS kernels
Chuck Lever [Sat, 13 Jul 2024 18:15:48 +0000 (14:15 -0400)] 
fanotify.7: Document changes backported to LTS kernels

Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Message-ID: <20240713181548.38002-4-cel@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agofanotify_mark.2: Support for FA_* flags has been backported to LTS kernels
Chuck Lever [Sat, 13 Jul 2024 18:15:46 +0000 (14:15 -0400)] 
fanotify_mark.2: Support for FA_* flags has been backported to LTS kernels

Cc: <linux-fsdevel@vger.kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Message-ID: <20240713181548.38002-2-cel@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agolistmount.2: Add page
Josef Bacik [Tue, 9 Jul 2024 18:31:23 +0000 (14:31 -0400)] 
listmount.2: Add page

Cc: Christian Brauner <brauner@kernel.org>
Cc: Miklos Szeredi <mszeredi@redhat.com>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: <kernel-team@fb.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Message-ID: <2d72a44fa49f47bd7258d7efb931926b26de4004.1720549824.git.josef@toxicpanda.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/: Skip expected warnings
Alejandro Colomar [Mon, 22 Jul 2024 20:15:34 +0000 (22:15 +0200)] 
share/mk/: Skip expected warnings

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoprctl.2: Add PR_RISCV_SET_ICACHE_FLUSH_CTX
Charlie Jenkins [Tue, 9 Jul 2024 17:56:52 +0000 (10:56 -0700)] 
prctl.2: Add PR_RISCV_SET_ICACHE_FLUSH_CTX

Document the PR_RISCV_SET_ICACHE_FLUSH_CTX flag for prctl(2) that is
supported as of Linux 6.10.

Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Message-ID: <20240709-fencei_prctl-v5-1-a0391069f746@rivosinc.com>
[alx: ffix + consistent line breaks]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/: Silence spurious warnings
Alejandro Colomar [Sat, 20 Jul 2024 10:59:34 +0000 (12:59 +0200)] 
share/mk/: Silence spurious warnings

Those write(2) calls are unimportant, and we don't want to check errors.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshm_open.3: EXAMPLES: Add missing error handling
Alejandro Colomar [Sat, 20 Jul 2024 10:38:21 +0000 (12:38 +0200)] 
shm_open.3: EXAMPLES: Add missing error handling

Reported-by: gcc(1) (`make build-ex-cc`)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agogetutent.3: EXAMPLES: Add missing error handling
Alejandro Colomar [Sat, 20 Jul 2024 10:28:00 +0000 (12:28 +0200)] 
getutent.3: EXAMPLES: Add missing error handling

Reported-by: gcc(1) (`make build-ex-cc`)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agopipe.2: EXAMPLES: Add missing error handling
Alejandro Colomar [Sat, 20 Jul 2024 10:09:26 +0000 (12:09 +0200)] 
pipe.2: EXAMPLES: Add missing error handling

Reported-by: gcc(1) (`make build-ex-cc`)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoperf_event_open.2: EXAMPLES: Add missing error handling
Alejandro Colomar [Sat, 20 Jul 2024 09:44:36 +0000 (11:44 +0200)] 
perf_event_open.2: EXAMPLES: Add missing error handling

GCC now enables -Wunused-result by default.

Reported-by: gcc(1) (`make build-ex-cc`)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/: Silence spurious warnings
Alejandro Colomar [Sat, 20 Jul 2024 09:26:22 +0000 (11:26 +0200)] 
share/mk/: Silence spurious warnings

Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/: Reduce the work of 'make && make install'
Alejandro Colomar [Thu, 18 Jul 2024 10:18:23 +0000 (12:18 +0200)] 
share/mk/: Reduce the work of 'make && make install'

Distros expect 'make' to build only what they need.  While we want to
build more stuff upstream, for various reasons (mainly, for extra
diagnostics), packagers only want what they'll use, and don't want to
waste CPU time with that.

Also, distros expect 'make install' to only install what they'll use,
which is just the manual pages.

For that, repurpose the build and install targets to do precisely that,
and add build-all and install-all targets that do all that can be done.

Reported-by: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 791f163b1a72 (2024-07-18, "share/mk/: Reduce the work of 'make && make install'")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined
Alejandro Colomar [Wed, 17 Jul 2024 17:02:52 +0000 (19:02 +0200)] 
share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined

Some distros patch GCC to have that definition built in.  Redefining it
ourselves would result in a redefinition, and consequently a diagnostic.

Reported-by: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 31bfd8f14a11 (2024-07-17, "share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/, share/tests/: Refactor *FLAGS and LDLIBS variables
Alejandro Colomar [Tue, 16 Jul 2024 15:18:22 +0000 (17:18 +0200)] 
share/mk/, share/tests/: Refactor *FLAGS and LDLIBS variables

Standard behavior is that setting these variables should append, not
overwrite.

Add variables to allow overwriting, with a trailing '_'.

While at it, put CPPFLAGS after CFLAGS consistently (previously, there
was a mix).

Link: <https://lists.gnu.org/archive/html/help-make/2024-07/msg00001.html>
Reported-by: Sam James <sam@gentoo.org>
Reported-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Suggested-by: Sébastien Hinderer <Sebastien.Hinderer@inria.fr>
Suggested-by: Paul Smith <psmith@gnu.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 5613b2846104 (2024-07-16, "share/mk/, share/tests/: Refactor *FLAGS and LDLIBS variables")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
12 months agoshare/mk/: CPPFLAGS: -D_FORTIFY_SOURCE=2
Alejandro Colomar [Mon, 15 Jul 2024 16:42:52 +0000 (18:42 +0200)] 
share/mk/: CPPFLAGS: -D_FORTIFY_SOURCE=2

Signed-off-by: Alejandro Colomar <alx@kernel.org>
Cherry-picked-from: liba2i.git 828dd1d21b30 (2024-07-15, "share/mk/: CPPFLAGS: -D_FORTIFY_SOURCE=2")
Signed-off-by: Alejandro Colomar <alx@kernel.org>