]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
3 months agoman/man2/close_range.2: EXAMPLES: Correct output of example program
Quentin Armitage [Mon, 28 Apr 2025 13:50:48 +0000 (14:50 +0100)] 
man/man2/close_range.2: EXAMPLES: Correct output of example program

The output shown for the example program listed /tmp/b twice;
the second /tmp/b should be /tmp/c.

Fixes: 336bd62ba24c (2021-03-21; "close_range.2: Include a better example program")
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Message-ID: <e8519ea77798c68944717bc6437052a1119a911f.camel@armitage.org.uk>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man2/mmap.2: CAVEATS: Document danger of mappings larger than PTRDIFF_MAX
Jann Horn [Tue, 29 Apr 2025 16:43:59 +0000 (18:43 +0200)] 
man/man2/mmap.2: CAVEATS: Document danger of mappings larger than PTRDIFF_MAX

References:
 - C99 draft: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
   section "6.5.6 Additive operators", paragraph 9
 - object size restriction in GCC:
   https://gcc.gnu.org/legacy-ml/gcc/2011-08/msg00221.html
 - glibc malloc restricts object size to <=PTRDIFF_MAX in
   checked_request2size() since glibc v2.30 (released in 2019, as pointed
   out by Jakub Wilk):
   https://sourceware.org/cgit/glibc/commit/?id=9bf8e29ca136094f

Signed-off-by: Jann Horn <jannh@google.com>
Message-ID: <20250429164359.2699330-1-jannh@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man2/ioctl_userfaultfd.2, man/man2const/UFFDIO_MOVE.2const: Document UFFDIO_MOVE
Suren Baghdasaryan [Wed, 23 Apr 2025 19:53:09 +0000 (12:53 -0700)] 
man/man2/ioctl_userfaultfd.2, man/man2const/UFFDIO_MOVE.2const: Document UFFDIO_MOVE

Documentation was extracted from the original patch written by Andrea
Arcangeli and upstreamed in [1].  Minor edits were made to maintain
the same documentation style as other userfaultfd ioctl commands.

[1] <https://lore.kernel.org/all/20231206103702.3873743-3-surenb@google.com/>

Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Message-ID: <20250423195309.2841410-1-surenb@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man2/madvise.2: Update MADV_GUARD_INSTALL, MADV_GUARD_REMOVE for Linux 6.15
Lorenzo Stoakes [Wed, 23 Apr 2025 18:31:05 +0000 (19:31 +0100)] 
man/man2/madvise.2: Update MADV_GUARD_INSTALL, MADV_GUARD_REMOVE for Linux 6.15

Lightweight guard region support has been extended in Linux 6.15,
permitting the use of these features for file-backed and read-only
mappings.

Update the description for these operations in the madvise manpage to
describe the changed behaviour.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Message-ID: <20250423183105.116978-1-lorenzo.stoakes@oracle.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man3/slist.3: SYNOPSIS: Add missing argument
Solomon Tan [Sun, 20 Apr 2025 12:44:48 +0000 (12:44 +0000)] 
man/man3/slist.3: SYNOPSIS: Add missing argument

Fixes: bb8164dec0c4 (2020-10-22; "slist.3: ffix: Use man markup")
Signed-off-by: Solomon Tan <wjsota@icloud.com>
Message-ID: <20250420124447.1552510-2-wjsota@icloud.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man7/mctp.7: Document Linux MCTP support
Jeremy Kerr [Thu, 17 Apr 2025 02:50:07 +0000 (10:50 +0800)] 
man/man7/mctp.7: Document Linux MCTP support

This change adds a brief description for the new Management Component
Transport Protocol (MCTP) support added to Linux as of
linux.git bc49d8169aa7 (2021-07-29; "mctp: Add MCTP base").

This is a fairly regular sockets-API implementation, so we're just
describing the semantics of socket(2), bind(2), sendto(2), and
recvfrom(2) for the new protocol.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Message-ID: <20250417-mctp-v3-1-07fff4d26f73@codeconstruct.com.au>
[alx: minor tweaks]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man3/abs.3: Remove NOTES section
Alejandro Colomar [Mon, 14 Apr 2025 08:59:21 +0000 (10:59 +0200)] 
man/man3/abs.3: Remove NOTES section

This seems to be about implementation details that are unimportant to
programmers.  It is widely understood that compilers may optimize some
libc calls.

Cc: Anton Zellerhoff <wg14@ascz.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man3/abs.3: Reorganize page
Alejandro Colomar [Mon, 14 Apr 2025 08:56:45 +0000 (10:56 +0200)] 
man/man3/abs.3: Reorganize page

Cc: Anton Zellerhoff <wg14@ascz.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man3/abs.3: Document u{,l,ll,imax}abs()
Anton Zellerhoff [Sun, 13 Apr 2025 17:50:11 +0000 (19:50 +0200)] 
man/man3/abs.3: Document u{,l,ll,imax}abs()

C2Y adds unsigned versions of the abs functions (see C2Y draft N3467 and
proposal N3349).  Support for these functions will be included in GCC 15
and glibc 2.42.

Link: <https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3467.pdf>
Link: <https://www.open-std.org/JTC1/SC22/WG14/www/docs/n3349.pdf>
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117024>
Link: <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=5b132ec2b7712dbc055838b3b538b83ad1196414>
Signed-off-by: Anton Zellerhoff <wg14@ascz.de>
Message-ID: <28a36070fe18707ab9fa26b91c88e6fd87a72097.1744566285.git.wg14@ascz.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man?/fanotify*: Document mount namespace events
Amir Goldstein [Fri, 4 Apr 2025 10:47:23 +0000 (12:47 +0200)] 
man/man?/fanotify*: Document mount namespace events

Used to subscribe for notifications for when mounts
are attached/detached from a mount namespace.

Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Miklos Szeredi <mszeredi@redhat.com>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250404104723.1709188-2-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man?/fanotify*: Reorganize documentation of FAN_FS_ERROR
Amir Goldstein [Fri, 4 Apr 2025 10:47:22 +0000 (12:47 +0200)] 
man/man?/fanotify*: Reorganize documentation of FAN_FS_ERROR

The order of FAN_FS_ERROR entry in the event section was rather
arbitrary inside the group of fid info events.

FAN_FS_ERROR is a special event with error info, so place its entry
after the entries for fid info events and before the entries for
permission events.

Reduce unneeded newlines in the FAN_FS_ERROR entry.

Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250404104723.1709188-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man7/fanotify.7: ffix
Alejandro Colomar [Wed, 2 Apr 2025 21:13:56 +0000 (23:13 +0200)] 
man/man7/fanotify.7: ffix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man7/fanotify.7: Document FAN_RESPONSE_INFO_AUDIT_RULE
Amir Goldstein [Mon, 31 Mar 2025 08:27:58 +0000 (10:27 +0200)] 
man/man7/fanotify.7: Document FAN_RESPONSE_INFO_AUDIT_RULE

Document FAN_RESPONSE_INFO_AUDIT_RULE extended response info record
that was added in v6.3.

Cc: Jan Kara <jack@suse.cz>
Cc: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250331082759.1424401-2-amir73il@gmail.com>
[alx: ffix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man?/fanotify*: Document FAN_PRE_ACCESS event
Amir Goldstein [Sun, 30 Mar 2025 12:55:36 +0000 (14:55 +0200)] 
man/man?/fanotify*: Document FAN_PRE_ACCESS event

The new FAN_PRE_ACCESS events are created before access to a file range,
to provides an opportunity for the event listener to modify the content
of the object before the user can accesss it.

Those events are available for group in class FAN_CLASS_PRE_CONTENT
They are reported with FAN_EVENT_INFO_TYPE_RANGE info record.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250330125536.1408939-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man?/fanotify*: Document FAN_REPORT_FD_ERROR
Amir Goldstein [Mon, 31 Mar 2025 13:39:57 +0000 (15:39 +0200)] 
man/man?/fanotify*: Document FAN_REPORT_FD_ERROR

This flag from v6.13 allows reporting detailed errors on failure to
open a file descriptor for an event.

This API was backported to LTS kernels v6.12.4 and v6.6.66.

Cc: Krishna Vivek Vitta <kvitta@microsoft.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250331133959.1436376-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man3type/intptr_t.3type: tfix
Miroslav Cimerman [Wed, 2 Apr 2025 16:27:26 +0000 (16:27 +0000)] 
man/man3type/intptr_t.3type: tfix

Signed-off-by: Miroslav Cimerman <mc@doas.su>
Message-ID: <wsk_s0nLv-HYkjBgAMVkOJW4DSkT5iYYr2anB6R-7X8ftiYyEKKOuNqJlE1jtRjeZjSvnlkxJ4Lm50DmcuS9ftSR_OQxu-8RcySOD5vTaKk=@doas.su>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
3 months agoman/man2/open_by_handle_at.2: srcfix
Alejandro Colomar [Wed, 2 Apr 2025 19:53:30 +0000 (21:53 +0200)] 
man/man2/open_by_handle_at.2: srcfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man7/fanotify.7: Document FAN_DENY_ERRNO()
Amir Goldstein [Mon, 31 Mar 2025 08:27:59 +0000 (10:27 +0200)] 
man/man7/fanotify.7: Document FAN_DENY_ERRNO()

Document FAN_DENY_ERRNO(), which was added in Linux 6.13 to
report specific errors on file access.

Cc: Jan Kara <jack@suse.cz>
Cc: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250331082759.1424401-3-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man7/fanotify.7: The response field is now a bit mask instead of an enum
Amir Goldstein [Mon, 31 Mar 2025 08:27:57 +0000 (10:27 +0200)] 
man/man7/fanotify.7: The response field is now a bit mask instead of an enum

Since the introduction of the FAN_AUDIT response flag,
the response field of fanotify_response is no longer an enum
it is now a bitmask, so fix the wording around FAN_ALLOW and
FAN_DENY.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250331082759.1424401-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/open_by_handle_at.2: name_to_handle_at(): Document the AT_HANDLE_CONNECTABLE...
Amir Goldstein [Mon, 31 Mar 2025 08:16:42 +0000 (10:16 +0200)] 
man/man2/open_by_handle_at.2: name_to_handle_at(): Document the AT_HANDLE_CONNECTABLE flag

A flag since Linux 6.13 to indicate that the requested file_handle is
intended to be used for open_by_handle_at(2) to obtain an open file
with a known path.

Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250331081642.1423812-2-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/open_by_handle_at.2: name_to_handle_at(): Document the AT_HANDLE_MNT_ID_UNIQ...
Amir Goldstein [Mon, 31 Mar 2025 08:16:41 +0000 (10:16 +0200)] 
man/man2/open_by_handle_at.2: name_to_handle_at(): Document the AT_HANDLE_MNT_ID_UNIQUE flag

A flag since Linux 6.12 to indicate that the requested mount_id is
a 64-bit unique id.

Cc: Chuck Lever <chuck.lever@oracle.com>
Cc: Jeff Layton <jlayton@poochiereds.net>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-ID: <20250331081642.1423812-1-amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2const/TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes: TIOCL_...
Günther Noack [Sun, 30 Mar 2025 14:30:40 +0000 (16:30 +0200)] 
man/man2const/TIOCLINUX.2const: Document missing TIOCL_SETSEL selection modes: TIOCL_SELPOINTER, TIOCL_SELCLEAR, TIOCL_SELMOUSEREPORT

Documents the following TIOCL_SETSEL sub-operations:

*  TIOCL_SELPOINTER
*  TIOCL_SELCLEAR
*  TIOCL_SELMOUSEREPORT

These previously undocumented selection modes for the Linux console
are implemented in <drivers/tty/vt/selection.c>.  The name "selection
mode" is slightly misleading as not all of them actually manipulate
the kernel's mouse selection buffer.

Includes clarified semantics pointed out by Jared Finder.

Cc: Hanno Böck <hanno@hboeck.de>
Cc: Jann Horn <jannh@google.com>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Message-ID: <20250330143038.4184-5-gnoack3000@gmail.com>
Acked-by: Jared Finder <jared@finder.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2const/TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection...
Günther Noack [Sun, 30 Mar 2025 14:30:39 +0000 (16:30 +0200)] 
man/man2const/TIOCLINUX.2const: Restructure documentation for TIOCL_SETSEL selection modes

*  Indent the documented selection modes into tagged paragraphs.
*  Document constants from the header file <tiocl.h> instead of numbers.
*  Clarify expansion semantics as suggested by Jared Finder.

Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Message-ID: <20250330143038.4184-4-gnoack3000@gmail.com>
Acked-by: Jared Finder <jared@finder.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/: Use 'path' instead of 'pathname' for parameters
Alejandro Colomar [Sun, 30 Mar 2025 22:24:43 +0000 (00:24 +0200)] 
man/man3/: Use 'path' instead of 'pathname' for parameters

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/mkfifo.3: PATH_MAX limits the size, not the length
Alejandro Colomar [Sun, 30 Mar 2025 22:23:42 +0000 (00:23 +0200)] 
man/man3/mkfifo.3: PATH_MAX limits the size, not the length

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man7/boot.7: wsfix
Alejandro Colomar [Sun, 30 Mar 2025 20:12:21 +0000 (22:12 +0200)] 
man/man7/boot.7: wsfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/: Use 'path' instead of 'pathname' for parameters
Alejandro Colomar [Sun, 30 Mar 2025 19:00:40 +0000 (21:00 +0200)] 
man/: Use 'path' instead of 'pathname' for parameters

It's just as informative, and takes less space.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/execve.2: Remove redundant text
Alejandro Colomar [Sun, 30 Mar 2025 19:51:15 +0000 (21:51 +0200)] 
man/man2/execve.2: Remove redundant text

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agosrc/bin/mansect: Use exit(1) instead of return
Alejandro Colomar [Sun, 30 Mar 2025 19:02:05 +0000 (21:02 +0200)] 
src/bin/mansect: Use exit(1) instead of return

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/: srcfix (\fX => \f[X])
Alejandro Colomar [Mon, 17 Jul 2023 20:43:18 +0000 (22:43 +0200)] 
man/: srcfix (\fX => \f[X])

While doing this global change, fix other minor issues found nearby.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/recv.2: Don't use 0 as a null pointer constant
Peter Radisson [Sat, 29 Mar 2025 18:20:18 +0000 (19:20 +0100)] 
man/man2/recv.2: Don't use 0 as a null pointer constant

It was probably a typo, since in sendto(2) this is (..., NULL, 0).

Signed-off-by: Peter Radisson <radisson97@web.de>
Message-ID: <189ef077-18f4-43a3-9008-286a75e7bd91@web.de>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/posix_fadvise.2: Consistency fix (len => size)
Alejandro Colomar [Tue, 25 Mar 2025 00:45:01 +0000 (01:45 +0100)] 
man/man2/posix_fadvise.2: Consistency fix (len => size)

Fixes: 18e7c4597c4e (2024-11-17; "man/: Terminology consistency reforms (n, size, length)")
Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=219921>
Reported-by: Paul Pluzhnikov <ppluzhnikov@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/strto[u]l.3: C23 added "0b" and "0B"
Alejandro Colomar [Sun, 23 Mar 2025 18:47:33 +0000 (19:47 +0100)] 
man/man3/strto[u]l.3: C23 added "0b" and "0B"

Link: <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=64924422a99690d147a166b4de3103f3bf3eaf6c>
Reported-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/strtoul.3: The prefix "0X" is equivalent to "0x"
Alejandro Colomar [Sun, 23 Mar 2025 18:43:37 +0000 (19:43 +0100)] 
man/man3/strtoul.3: The prefix "0X" is equivalent to "0x"

strtol(3) mentiones both, but this page somehow forgot the uppercase
variant.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/strtol.3: CAVEATS: Clarify how to perform range checks
Alejandro Colomar [Fri, 21 Mar 2025 22:13:50 +0000 (23:13 +0100)] 
man/man3/strtol.3: CAVEATS: Clarify how to perform range checks

Reported-by: Bruno Haible <bruno@clisp.org>
Co-authored-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/strto[u]l.3: BUGS: Signed numbers and white space are not rejected
Alejandro Colomar [Fri, 21 Mar 2025 20:35:52 +0000 (21:35 +0100)] 
man/man3/strto[u]l.3: BUGS: Signed numbers and white space are not rejected

Link: <https://stackoverflow.com/questions/60955490/strtoul-what-is-the-correct-return-value-for-very-negative-strings>
Reported-by: Bruno Haible <bruno@clisp.org>
Co-authored-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/wc{,r}tomb.3: wfix regarding MB_CUR_MAX
Kang-Che Sung [Sun, 16 Mar 2025 18:32:13 +0000 (02:32 +0800)] 
man/man3/wc{,r}tomb.3: wfix regarding MB_CUR_MAX

Add the missing length requirement about MB_CUR_MAX to wcrtomb(3).

Change the wording on the MB_CUR_MAX requirement in wctomb(3). If
programmers know the wide character to convert beforehand, they are
allowed to use a buffer smaller than MB_CUR_MAX bytes, as long as it
"fits" the sequence.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
Message-ID: <CADDzAfN7_kdv4iQtH=OpgSWtRuqOZXYhxsBiz_OF8Zqf-zy4_Q@mail.gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/get_mempolicy.2: SYNOPSIS: Use GNU fwd declaration of parameters for sizes...
Alejandro Colomar [Thu, 20 Mar 2025 22:13:35 +0000 (23:13 +0100)] 
man/man2/get_mempolicy.2: SYNOPSIS: Use GNU fwd declaration of parameters for sizes of array parameters

I forgot to include this change in the global change applied recently.

Fixes: d2c2db8830f8 (2025-03-14; "man/: SYNOPSIS: Use GNU forward-declarations of parameters for sizes of array parameters")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/: SYNOPSIS: Use GNU forward-declarations of parameters for sizes of array parameters
Alejandro Colomar [Fri, 14 Mar 2025 17:33:41 +0000 (18:33 +0100)] 
man/: SYNOPSIS: Use GNU forward-declarations of parameters for sizes of array parameters

This syntax has been proposed for standardization in N3433.

Link: <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3433.pdf>
Cc: Christopher Bazley <chris.bazley.wg14@gmail.com>
Cc: Martin Uecker <uecker@tugraz.at>
Cc: Joseph Myers <josmyers@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoetc/cppcheck/cppcheck.suppress: Suppress staticFunction
Alejandro Colomar [Fri, 14 Mar 2025 17:49:48 +0000 (18:49 +0100)] 
etc/cppcheck/cppcheck.suppress: Suppress staticFunction

For example, in backtrace(3) we don't want to use 'static'.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/: EXAMPLES: Add missing 'static'
Alejandro Colomar [Fri, 14 Mar 2025 17:46:51 +0000 (18:46 +0100)] 
man/: EXAMPLES: Add missing 'static'

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoetc/cppcheck/cppcheck.suppress: Suppress nullPointerOutOfMemory
Alejandro Colomar [Fri, 14 Mar 2025 17:41:13 +0000 (18:41 +0100)] 
etc/cppcheck/cppcheck.suppress: Suppress nullPointerOutOfMemory

It causes false positives:

CPPCHECK .tmp/man/man2/open_by_handle_at.2.d/t_name_to_handle_at.c.lint-c.cppcheck.touch
.tmp/man/man2/open_by_handle_at.2.d/t_name_to_handle_at.c:35:5: warning: inconclusive: If memory allocation fails, then there is a possible null pointer dereference: fhp [nullPointerOutOfMemory]
    fhp->handle_bytes = 0;
    ^
.tmp/man/man2/open_by_handle_at.2.d/t_name_to_handle_at.c:26:17: note: Assuming allocation function fails
    fhp = malloc(fhsize);
                ^
.tmp/man/man2/open_by_handle_at.2.d/t_name_to_handle_at.c:26:17: note: Assignment 'fhp=malloc(fhsize)', assigned value is 0
    fhp = malloc(fhsize);
                ^
.tmp/man/man2/open_by_handle_at.2.d/t_name_to_handle_at.c:35:5: note: Null pointer dereference
    fhp->handle_bytes = 0;
    ^

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man3/: SYNOPSIS: Fix incorrect array parameters
Alejandro Colomar [Fri, 14 Mar 2025 16:58:20 +0000 (17:58 +0100)] 
man/man3/: SYNOPSIS: Fix incorrect array parameters

See the non-wide equivalent functions.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/getsockopt.2: SYNOPSIS: Add missing _Nullable qualifier
Alejandro Colomar [Fri, 14 Mar 2025 12:55:20 +0000 (13:55 +0100)] 
man/man2/getsockopt.2: SYNOPSIS: Add missing _Nullable qualifier

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man7/ip.7: Document capabilities to use IP_TRANSPARENT
Matthieu Buffet [Fri, 7 Mar 2025 22:22:44 +0000 (23:22 +0100)] 
man/man7/ip.7: Document capabilities to use IP_TRANSPARENT

CAP_NET_ADMIN has been overkill to use setsockopt(IP_TRANSPARENT)
since a discussion on LKML[1] and a patch[2] in 2011.  All that is
left to do is to let devs know they don't need CAP_NET_ADMIN.

[2] linux.git 6cc7a765c298 (2011-10-20; "net: allow CAP_NET_RAW to set socket options IP{,V6}_TRANSPARENT")

Link: [1] <https://lore.kernel.org/netdev/20111020.182214.629562655202957174.davem@davemloft.net/T/>
Signed-off-by: Matthieu Buffet <matthieu@buffet.re>
Message-ID: <20250307222244.597006-1-matthieu@buffet.re>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoStart of man-pages-NEXT: Move Changes to Changes.old
Alejandro Colomar [Thu, 6 Mar 2025 22:56:43 +0000 (23:56 +0100)] 
Start of man-pages-NEXT: Move Changes to Changes.old

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agolsm: Released 6.13
Alejandro Colomar [Thu, 6 Mar 2025 22:55:05 +0000 (23:55 +0100)] 
lsm: Released 6.13

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoChanges: Ready for 6.13 man-pages-6.13
Alejandro Colomar [Thu, 6 Mar 2025 22:49:09 +0000 (23:49 +0100)] 
Changes: Ready for 6.13

Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man7/landlock.7: Document IPC scoping (Landlock ABI v6)
Günther Noack [Mon, 3 Mar 2025 19:50:31 +0000 (20:50 +0100)] 
man/man7/landlock.7: Document IPC scoping (Landlock ABI v6)

With this ABI version, Landlock can restrict outgoing interactions with
higher-privileged Landlock domains through Abstract Unix Domain sockets
and signals.

Terminology:

*  The *IPC Scope* of a Landlock domain is that Landlock domain and its
   nested domains.

*  An *operation* (e.g., signaling, connecting to abstract UDS) is said
   to be *scoped within a domain* when the flag for that operation was
   set at ruleset creation time.  This means that for the purpose of
   this operation, only processes within the domain's IPC scope are
   reachable.

Link: <https://lore.kernel.org/all/20250303194510.135506-4-gnoack@google.com/>
Signed-off-by: Günther Noack <gnoack@google.com>
Cc: Mickaël Salaün <mic@digikod.net>
Cc: Tahera Fahimi <fahimitahera@gmail.com>
Cc: Tanya Agarwal <tanyaagarwal25699@gmail.com>
Cc: Daniel Burgener <dburgener@linux.microsoft.com>
Cc: <linux-security-module@vger.kernel.org>
Message-ID: <20250303195056.136777-4-gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man7/landlock.7: Document network support
Günther Noack [Mon, 3 Mar 2025 19:50:29 +0000 (20:50 +0100)] 
man/man7/landlock.7: Document network support

Copy over the existing wording from kernel documentation,
as it was introduced in Linux commit
51442e8d64bc (2023-10-26, "landlock: Document network support").
Landlock rules are not only about the filesystem any more
and the new wording is more appropriate.

Signed-off-by: Günther Noack <gnoack@google.com>
Cc: Mickaël Salaün <mic@digikod.net>
Cc: Tahera Fahimi <fahimitahera@gmail.com>
Cc: Tanya Agarwal <tanyaagarwal25699@gmail.com>
Cc: Daniel Burgener <dburgener@linux.microsoft.com>
Cc: <linux-security-module@vger.kernel.org>
Message-ID: <20250303195056.136777-2-gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
4 months agoman/man2/mkdir.2: ffix
Chen Linxuan [Mon, 3 Mar 2025 09:50:57 +0000 (17:50 +0800)] 
man/man2/mkdir.2: ffix

Fixes: 2904e040ded2 (2025-02-02; "man/man2/mkdir.2: ERRORS: Add EOVERFLOW")
Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
Message-ID: <6DF9A4EE0A868FB4+20250303095057.92138-1-chenlinxuan@uniontech.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoshare/mk/build/pdf/book/prepare.pl: Add support for the Unix V10 manual
Deri James [Mon, 17 Feb 2025 18:52:46 +0000 (18:52 +0000)] 
share/mk/build/pdf/book/prepare.pl: Add support for the Unix V10 manual

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoshare/mk/: Don't pass an escaped # to grep(1)
Alejandro Colomar [Thu, 27 Feb 2025 19:13:34 +0000 (20:13 +0100)] 
share/mk/: Don't pass an escaped # to grep(1)

We need to escape the # for old versions of make(1).  However, new
versions of grep(1) diagnose if it receives an escaped #.  To keep both
make(1) and grep(1) happy in both their old and new versions, we need to
take advantage of # not being a comment in bash(1) when not preceeded by
a space, and also of \# being translated into # by bash(1).

        alx@debian:~$ echo ''\#
        #
        alx@debian:~$ echo ''#
        #

Fixes: 76f12e3fd3ea (2025-02-10; "share/mk/: Escape '#' in regexes")
Reported-by: Sergei Trofimovich <slyich@gmail.com>
Cc: Florian Weimer <fw@deneb.enyo.de>
Cc: Boris Pigin <boris.pigin@gmail.com>
Suggested-by: Jakub Wilk <jwilk@jwilk.net>
References: <20250227162800.36exbwmqky6d7z4t@jwilk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man3/static_assert.3: EXAMPLES: Remove unused include
Alejandro Colomar [Sun, 23 Feb 2025 18:01:28 +0000 (19:01 +0100)] 
man/man3/static_assert.3: EXAMPLES: Remove unused include

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoshare/mk/: diffoscope(1) is in the diffoscope-minimal package
Alejandro Colomar [Sun, 23 Feb 2025 17:52:19 +0000 (18:52 +0100)] 
share/mk/: diffoscope(1) is in the diffoscope-minimal package

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoChanges.old: Fix location name
Alejandro Colomar [Mon, 24 Feb 2025 08:54:36 +0000 (09:54 +0100)] 
Changes.old: Fix location name

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoStart of man-pages-NEXT: Move Changes to Changes.old
Alejandro Colomar [Mon, 24 Feb 2025 08:52:55 +0000 (09:52 +0100)] 
Start of man-pages-NEXT: Move Changes to Changes.old

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agolsm: Released 6.12
Alejandro Colomar [Mon, 24 Feb 2025 08:33:33 +0000 (09:33 +0100)] 
lsm: Released 6.12

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoChanges: Ready for 6.12 man-pages-6.12
Alejandro Colomar [Sat, 22 Feb 2025 10:36:07 +0000 (11:36 +0100)] 
Changes: Ready for 6.12

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man2/{mbind,set_mempolicy}.2: Document MPOL_PREFERRED_MANY
Matthew Cassell [Thu, 20 Feb 2025 22:52:32 +0000 (16:52 -0600)] 
man/man2/{mbind,set_mempolicy}.2: Document MPOL_PREFERRED_MANY

Browsing a header file in the kernel source and saw the memory policy
enum used for mbind() and set_mempolicy() using an entry that I didn't
recognize.  I man 2'd both system calls and didn't see an entry for
MPOL_PREFERRED_MANY.  The commit on the enum entry:

linux.git b27abaccf8e8 (2021-09-02; "mm/mempolicy: add
MPOL_PREFERRED_MANY for multiple preferred nodes")

The commit message gives the rationale as to why the MPOL_PREFERRED_MANY
mode would be beneficial.  Giving the ability to set the memory policy
to target different tiers of memory over various NUMA nodes.

Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Matthew Cassell <mcassell411@gmail.com>
Message-ID: <20250220225232.2138-1-mcassell411@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man3/getcwd.3: tfix (pathname => pathnames)
Askar Safin [Thu, 20 Feb 2025 09:19:26 +0000 (09:19 +0000)] 
man/man3/getcwd.3: tfix (pathname => pathnames)

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Askar Safin <safinaskar@zohomail.com>
Message-ID: <20250220091926.3985504-3-safinaskar@zohomail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man3/getcwd.3: VERSIONS: The syscall can return "(unreachable)", but modern glibc...
Askar Safin [Thu, 20 Feb 2025 09:19:25 +0000 (09:19 +0000)] 
man/man3/getcwd.3: VERSIONS: The syscall can return "(unreachable)", but modern glibc wrapper cannot

I verified using an expirement (see below) that the modern glibc wrapper
getcwd() actually never returns "(unreachable)".  I have also read the
modern glibc sources for all three functions documented here.  None of
them return "(unreachable)".

Now let me describe my expirement:

d-user@comp:/tmp$ cat getcwd.c
#include <unistd.h>
#include <stdio.h>
#include <sys/syscall.h>

int
main(void)
{
char  buf[1000];

if (syscall(SYS_getcwd, buf, sizeof(buf)) == -1)
perror("SYS_getcwd");
else
printf("SYS_getcwd: %s\n", buf);

if (getcwd(buf, sizeof(buf)) == NULL)
perror("getcwd");
else
printf("getcwd: %s\n", buf);

return 0;
}
d-user@comp:/tmp$ gcc -Wall -Wextra -o getcwd getcwd.c
d-user@comp:/tmp$ sudo unshare --mount bash
d-root@comp:/tmp# mkdir /tmp/dir
d-root@comp:/tmp# mount -t tmpfs tmpfs /tmp/dir
d-root@comp:/tmp# cd /tmp/dir
d-root@comp:/tmp/dir# umount -l .
d-root@comp:/tmp/dir# /tmp/getcwd
SYS_getcwd: (unreachable)/
getcwd: No such file or directory
d-root@comp:/tmp/dir# exit
exit

Link: <https://sourceware.org/bugzilla/show_bug.cgi?id=18203>
Link: <https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=52a713fdd0a30e1bd79818e2e3c4ab44ddca1a94>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Askar Safin <safinaskar@zohomail.com>
Message-ID: <20250220091926.3985504-2-safinaskar@zohomail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man3/ctime.3: Mention that timegm(3) is a UTC equivalent of mktime(3)
Alejandro Colomar [Tue, 18 Feb 2025 12:25:01 +0000 (13:25 +0100)] 
man/man3/ctime.3: Mention that timegm(3) is a UTC equivalent of mktime(3)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man7/mount_namespaces.7: Fix an incorrect path in an example
Göran Uddeborg [Sun, 16 Feb 2025 18:59:50 +0000 (19:59 +0100)] 
man/man7/mount_namespaces.7: Fix an incorrect path in an example

In the example showing how locked mounts in a less privileged mount
namespace can not be split, first </etc/shadow> is bind mounted, then an
attempt is done to unmount </mnt/dir>, which gives an error complaining
that </etc/shadow> is not mounted.  The unmount should also refer to
</etc/shadow>.

Fixes: 906ab4945cd3 (2021-08-20; "mount_namespaces.7: Rewrite locked mounts examples to use/etc/shadow")
Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=217709>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
Cc: Rajesh <r.pandian@gmail.com>
Message-ID: <26546.13734.573762.288144@gargle.gargle.HOWL>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoshare/mk/: Use ifndef and := instead of ?=
Alejandro Colomar [Sun, 16 Feb 2025 15:26:52 +0000 (16:26 +0100)] 
share/mk/: Use ifndef and := instead of ?=

The semantics of '?=' are similar to those of '=', but we need simple
assignment as if ':=', so we can't use '?='.  In the future, we'll be
able to use '?:='.  For now, let's use ifndef.

Fixes: 0d69e51cd4b8 (2025-02-10; "share/mk/: Use ?= assignments for user-facing variables")
Link: <https://lore.kernel.org/linux-man/378a2eba-c973-4de9-a362-6e25123bf75b@systematicsw.ab.ca/T/#m3be93ab6b875569178981b034b4a874632db2fa9>
Reported-by: Brian Inglis <brian.inglis@systematicsw.ab.ca>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoStart of man-pages-NEXT: Move Changes to Changes.old
Alejandro Colomar [Fri, 14 Feb 2025 20:07:36 +0000 (21:07 +0100)] 
Start of man-pages-NEXT: Move Changes to Changes.old

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agolsm: Released 6.11
Alejandro Colomar [Fri, 14 Feb 2025 19:47:15 +0000 (20:47 +0100)] 
lsm: Released 6.11

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoChanges: Ready for 6.11 man-pages-6.11
Alejandro Colomar [Fri, 14 Feb 2025 14:20:53 +0000 (15:20 +0100)] 
Changes: Ready for 6.11

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man2/kill.2: RETURN VALUE: Fix wording issue with sig=0
Amit Pinhas [Wed, 12 Feb 2025 20:56:20 +0000 (22:56 +0200)] 
man/man2/kill.2: RETURN VALUE: Fix wording issue with sig=0

The DESCRIPTION says:

If *sig* is 0, then no signal is sent, but existence and
permission checks are still performed; this can be used to
check for the existence of a process ID.

On the other hand, the `RETURN VALUE` section contradicted that.

On success (at least one signal was sent), zero is returned.  On
error, -1 is returned...

How can I get 0 when providing sig=0, if no signal was actually
sent, which is the criteria for success of this call???

Reported-by: Amit Pinhas <amitpinhass@gmail.com>
Co-authored-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Amit Pinhas <amitpinhass@gmail.com>
Message-ID: <a4fa37e0fc89a3c99982ace3fe381991ebe85b00.1739393685.git.amitpinhass@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man7/bpf-helpers.7: Refresh page from Linux v6.13
Alejandro Colomar [Wed, 12 Feb 2025 14:46:18 +0000 (15:46 +0100)] 
man/man7/bpf-helpers.7: Refresh page from Linux v6.13

Scripted change:

$ ~/src/linux/linux/v6.13/scripts/bpf_doc.py \
| rst2man \
>man7/bpf-helpers.7;

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoRELEASE: Document the production of the book
Alejandro Colomar [Wed, 12 Feb 2025 14:40:16 +0000 (15:40 +0100)] 
RELEASE: Document the production of the book

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoGNUmakefile: help: Show only variables assigned with '?='
Alejandro Colomar [Mon, 3 Feb 2025 10:02:47 +0000 (11:02 +0100)] 
GNUmakefile: help: Show only variables assigned with '?='

The others are internal stuff that most likely shouldn't be touched.

Cc: Sam James <sam@gentoo.org>
Cc: Paul Smith <psmith@gnu.org>
Cc: Guenther Noack <gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoshare/mk/: Use ?= assignments for user-facing variables
Alejandro Colomar [Mon, 3 Feb 2025 09:59:05 +0000 (10:59 +0100)] 
share/mk/: Use ?= assignments for user-facing variables

This allows users specifying them as environment variables.

Cc: Sam James <sam@gentoo.org>
Cc: Paul Smith <psmith@gnu.org>
Cc: Guenther Noack <gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoGNUmakefile: Require the user to specify '-R' if their make(1) is too old
Alejandro Colomar [Mon, 3 Feb 2025 09:12:28 +0000 (10:12 +0100)] 
GNUmakefile: Require the user to specify '-R' if their make(1) is too old

And everyone's make(1) is too old.  :-)

This will allow us to use ?= assignments.  Once a new GNU make(1)
release is done, we'll be able to rely on our setting of MAKEFLAGS+=-R
at the top of the GNUMakefile, but currently, that's not enough, and the
user must specify -R to unset implicit variables.

Cc: Sam James <sam@gentoo.org>
Cc: Paul Smith <psmith@gnu.org>
Cc: Guenther Noack <gnoack@google.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoshare/mk/: Escape '#' in regexes
Alejandro Colomar [Mon, 10 Feb 2025 10:56:01 +0000 (11:56 +0100)] 
share/mk/: Escape '#' in regexes

GNU make(1) 4.2 seems to be interpreting those characters as the start
of a comment, so we need to escape them.  That seems to calm those old
versions of make(1), and doesn't affect negatively the newer ones, and
doesn't affect negatively grep(1) either.

Fixes: 35a780a99bd8 (2024-07-20; "share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined")
Fixes: 2130162900ab (2024-11-03; "share/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scripts")
Reported-by: Boris Pigin <boris.pigin@gmail.com>
Cc: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man3/timespec_get.3: Correct return value and clarify description
Mark Harris [Sun, 9 Feb 2025 01:24:14 +0000 (17:24 -0800)] 
man/man3/timespec_get.3: Correct return value and clarify description

- 0, not -1, is returned for an unsupported time base or error
  (C23 7.29.2.6, 7.29.2.7; POSIX.1-2024 line 74358).
- Clarify that any supported value of base is always nonzero (i.e.,
  there is no overlap between the two return value cases that may
  require errno or some other source to disambiguate)
  (C23 7.29.2.6, 7.29.2.7; POSIX.1-2024 line 74357).
- Clarify that timespec_getres(NULL, base) is a valid call to check
  whether the specified time base is supported (C23 7.29.2.7).
- Clarify that the resolution for a particular time base is constant
  for the lifetime of the process (i.e., there is no need to retrieve
  it repeatedly) (C23 7.29.2.7).
- Calls to these functions are not technically equivalent to any
  clock_* function call; at least the return value will be different.
  Clarify that it is the time and resolution that are the same.
- The ERRORS section is removed, because it states only what is true
  for every function that does not state otherwise (i.e., errno might
  be affected by underlying system calls).

Fixes: 7bda5119fe5e (2024-09-08; "timespec_get.3, timespec_getres.3: Add page and link page")
Cc: наб <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Mark Harris <mark.hsj@gmail.com>
Message-ID: <5f8dc5d2dc51f080a18de53e98610df43389b98b.1739063937.git.mark.hsj@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoCONTRIBUTING.d/style/c: Add coding style for the example programs
Alejandro Colomar [Sat, 8 Feb 2025 22:38:00 +0000 (23:38 +0100)] 
CONTRIBUTING.d/style/c: Add coding style for the example programs

Personally, I prefer tabs for actual programming.  But for manual pages,
we can live with 4 spaces for $reasons.

Reported-by: "G. Branden Robinson" <branden@debian.org>
Reported-by: Jason Yundt <jason@jasonyundt.email>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoCONTRIBUTING.d/: Move style to style/man
Alejandro Colomar [Sat, 8 Feb 2025 21:39:55 +0000 (22:39 +0100)] 
CONTRIBUTING.d/: Move style to style/man

This makes room for adding <style/c>, a C coding style guide.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man3/regex.3: EXAMPLES: Don't use z length modifier with unsigned int
Arkadiusz Drabczyk [Fri, 7 Feb 2025 21:16:28 +0000 (22:16 +0100)] 
man/man3/regex.3: EXAMPLES: Don't use z length modifier with unsigned int

GCC and Clang print warnings:

    $ clang main.c -Wall
    main.c:30:23: warning: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'unsigned int' [-Wformat]
       30 |     printf("#%zu:\n", i);
          |              ~~~      ^
          |              %u
    1 warning generated.

    $ gcc main.c -Wall
    main.c: In function ‘main’:
    main.c:30:16: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 2 has type ‘unsigned int’ [-Wformat=]
       30 |     printf("#%zu:\n", i);
          |              ~~^      ~
          |                |      |
          |                |      unsigned int
          |                long unsigned int
          |              %u

Fixes: b42296e4feaf (2022-09-15; "Various pages: EXAMPLES: Use unsigned types for loop iterators")
Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
Message-ID: <20250207211628.25164-1-arkadiusz@drabczyk.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man2/clone.2: Use munmap(2) to free 'stack'
Alejandro Colomar [Tue, 21 Jan 2025 03:13:51 +0000 (11:13 +0800)] 
man/man2/clone.2: Use munmap(2) to free 'stack'

Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Reported-by: Chen Linxuan <chenlinxuan@uniontech.com>
Message-ID: <647EBDB1A8DE7507+20250121031351.548052-1-chenlinxuan@uniontech.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man2/mkdir.2: ERRORS: Add EOVERFLOW
Chen Linxuan [Sun, 2 Feb 2025 13:57:33 +0000 (21:57 +0800)] 
man/man2/mkdir.2: ERRORS: Add EOVERFLOW

mkdir(2) and mkdirat(2) might set errno to EOVERFLOW when UID or GID
mapping has not been configured.

Here's a small program that shows this behavior:

        #define _GNU_SOURCE
        #include <err.h>
        #include <sched.h>
        #include <stdlib.h>
        #include <sys/mman.h>
        #include <sys/mount.h>
        #include <sys/stat.h>
        #include <sys/wait.h>
        #include <unistd.h>

        static int
childFunc(void *_)
        {
                if (mount("tmpfs", "/tmp", "tmpfs", 0, NULL))
                        err(EXIT_FAILURE, "mount");

                if (mkdir("/tmp/test", 0755) == -1)
                        err(EXIT_FAILURE, "mkdir");

                return 0;
        }

        #define STACK_SIZE (1024 * 1024)

        int
main(void)
        {
                char   *stack; /* Start of stack buffer */
                char   *stackTop; /* End of stack buffer */
                pid_t  pid;

                stack = mmap(NULL, STACK_SIZE, PROT_READ | PROT_WRITE,
                             MAP_PRIVATE | MAP_ANONYMOUS | MAP_STACK,
                             -1, 0);
                if (stack == MAP_FAILED)
                        err(EXIT_FAILURE, "mmap");

                stackTop = stack + STACK_SIZE;

                pid = clone(childFunc, stackTop, CLONE_NEWUSER |
                            CLONE_NEWNS | SIGCHLD, NULL);
                if (munmap(stack, STACK_SIZE) == -1)
                        err(EXIT_FAILURE, "munmap");
                if (pid == -1)
                        err(EXIT_FAILURE, "clone");

                if (waitpid(pid, NULL, 0) == -1)
                        err(EXIT_FAILURE, "waitpid");

                exit(EXIT_SUCCESS);
        }

Link: <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=036d523641c66bef713042894a17f4335f199e49>
Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
Message-ID: <F22A2B1500170B63+20250202135733.11800-1-chenlinxuan@uniontech.com>
[alx: wfix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man7/signal.7: Update definition of SIGCHLD for POSIX.1-2001
Arkadiusz Drabczyk [Sun, 2 Feb 2025 13:03:31 +0000 (14:03 +0100)] 
man/man7/signal.7: Update definition of SIGCHLD for POSIX.1-2001

This is an XSI extension supported by Linux.

Link: <https://unix.stackexchange.com/q/790116/72304>
Link: <https://lore.kernel.org/linux-man/Z5U0Wh_KF3Ki62Pk@comp../>
Signed-off-by: Arkadiusz Drabczyk <arkadiusz@drabczyk.org>
Message-ID: <20250202130331.20320-1-arkadiusz@drabczyk.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man7/sched.7: Mention autogroup disabled behavior
Phil Auld [Thu, 16 Jan 2025 14:37:47 +0000 (14:37 +0000)] 
man/man7/sched.7: Mention autogroup disabled behavior

The autogroup feature can be contolled at runtime when built into the
kernel.  Disabling it in this case still creates autogroups and still
shows the autogroup membership for the task in /proc.  The scheduler
code will just not use the the autogroup task group.  This can be
confusing to users.  Add a sentence to this effect to sched.7 to point
this out.

The kernel code shows how this is used.  The sched_autogroup_enabled
toggle is only used in one place.

kernel/sched/autogroup.h:

static inline struct task_group *
autogroup_task_group(struct task_struct *p, struct task_group *tg)
{
extern unsigned int sysctl_sched_autogroup_enabled;
int enabled = READ_ONCE(sysctl_sched_autogroup_enabled);

if (enabled && task_wants_autogroup(p, tg))
return p->signal->autogroup->tg;

return tg;
}

task_wants_autogroup() is in kernel/sched/autogroup.c:

bool task_wants_autogroup(struct task_struct *p, struct task_group *tg)
{
if (tg != &root_task_group)
return false;
...

return true;
}

One can see that any group set other than root also bypasses the use of
the autogroup.  All of the machinery around the creation of the
autogroup is not effected by the toggle.

From userspace:
0
/autogroup-112 nice 0

Note, systemd based system these days is not really using autogroups at
all anyway because any task in a non-root cgroup bypasses the autogroup
as well.

Cc: Carlos O'Donell <codonell@redhat.com>
Signed-off-by: Phil Auld <pauld@redhat.com>
Message-ID: <20250116143747.2366152-1-pauld@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man2/rt_sigqueueinfo.2: tfix (tid => tgid)
Askar Safin [Thu, 30 Jan 2025 05:06:25 +0000 (08:06 +0300)] 
man/man2/rt_sigqueueinfo.2: tfix (tid => tgid)

Signed-off-by: Askar Safin <safinaskar@zohomail.com>
Message-ID: <20250130050625.3356602-1-safinaskar@zohomail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
5 months agoman/man5/proc_pid_limits.5: tfix
Alejandro Colomar [Sun, 2 Feb 2025 10:51:11 +0000 (11:51 +0100)] 
man/man5/proc_pid_limits.5: tfix

Reported-by: "Tomerius, Kai" <Kai.Tomerius@elektrobit.com>
Fixes: 07c3768e9db8 (2023-08-15; "proc.5, proc_pid_limits.5: Split /proc/PID/limits from proc(5)")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man7/pathname.7: Pathnames are opaque C strings
Alejandro Colomar [Mon, 27 Jan 2025 18:40:00 +0000 (19:40 +0100)] 
man/man7/pathname.7: Pathnames are opaque C strings

On Mon, Jan 27, 2025 at 07:27:59PM +0100, наб wrote:
> Skimming the thread: UNIX paths are sequences of non-NUL bytes.
>
> It is never correct to expect to be able to have a (parse, unparse)
> operation pair for which unparse(parse(x)) = x for path x.
>
> It's obviously wrong to reject a pathname just because you dont like it.
>
> Thus, when displaying a path, either (a) dump it directly to the output
> (the user has configured their display device to understand the paths they use),
> or if that's not possible (b) setlocale(LC_ALL, "") + mbrtowc() loop
> and render the result (applying usual ?/� substitutions for mbrtowc()
> errors makes sense here).
>
> There are very few operations on paths that are actually reasonable
> to do, ever; those are: appending stuff, prepending stuff
> (this is just appending stuff with the arguments backwards),
> and cleaving at /es;
> the "stuff" better be copied whole-sale from some other path
> or an unprocessed argument (or, sure, the PFCS).
>
> If you're getting bytes to append to a path, do that directly.
>
> If you're getting characters to append to a path,
> then wctomb(3) is the only non-invalid solution,
> since that (obviously) turns characters into bytes in the current
> locale, which (ex def) is the operation desired.
>
> I don't understand what the UTF-32 dance is supposed to be.
>
> If you're recommending transcoding paths, don't.
>
> To re-iterate: paths are not character sequences.
> They do not represent characters.
> You can't meaningfully coerce them thusly without loss of precision
> (this is ok to do for display! and nothing else).
> If at any point you find yourself turning wchar_t -> char
> you are doing something wrong;
> if you find yourself doing char -> wchar_t for anything beside display
> you should probably reconsider.
>
> This is different under Win32 of course. But that concerns us naught.

Suggested-by: наб <nabijaczleweli@nabijaczleweli.xyz>
Cc: Jason Yundt <jason@jasonyundt.email>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: "G. Branden Robinson" <branden@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man7/pathname.7: EXAMPLES: Use a non-ASCII filename
Alejandro Colomar [Mon, 27 Jan 2025 11:03:46 +0000 (12:03 +0100)] 
man/man7/pathname.7: EXAMPLES: Use a non-ASCII filename

The ASCII filename was too simple to actually show anything useful.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoshare/mk/build/: Ignore known errors with pathname.7
Alejandro Colomar [Thu, 23 Jan 2025 23:47:10 +0000 (00:47 +0100)] 
share/mk/build/: Ignore known errors with pathname.7

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man7/pathname.7: Add file documenting pathnames
Jason Yundt [Tue, 21 Jan 2025 13:35:20 +0000 (08:35 -0500)] 
man/man7/pathname.7: Add file documenting pathnames

The goal of this new manual page is to help people create programs that
do the right thing even in the face of unusual paths.  The information
that I used to create this new manual page came from these sources:

Link: <https://unix.stackexchange.com/a/39179/316181>
Link: <https://sourceware.org/pipermail/libc-help/2024-August/006737.html>
Link: <https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs/ext4/ext4.h?h=v6.12.9#n2288>
Link: <man:unix(7)>
Link: <https://unix.stackexchange.com/q/92426/316181>
Cc: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Jason Yundt <jason@jasonyundt.email>
Message-ID: <20250121133523.24606-1-jason@jasonyundt.email>
Cc: "G. Branden Robinson" <branden@debian.org>
[alx: wfix, ffix, and other tweaks]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoChanges.old: tfix
Alejandro Colomar [Sun, 26 Jan 2025 20:28:55 +0000 (21:28 +0100)] 
Changes.old: tfix

Reported-by: Brian Inglis <Brian.Inglis@SystematicSW.ab.ca>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoshare/mk/build/pdf/book/prepare.pl: Fix duplicate overview-panel entries
Deri [Thu, 23 Jan 2025 23:55:45 +0000 (00:55 +0100)] 
share/mk/build/pdf/book/prepare.pl: Fix duplicate overview-panel entries

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoChanges.old: tfix
Alejandro Colomar [Wed, 22 Jan 2025 22:36:57 +0000 (23:36 +0100)] 
Changes.old: tfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoStart of man-pages-NEXT: Move Changes to Changes.old
Alejandro Colomar [Wed, 22 Jan 2025 22:29:39 +0000 (23:29 +0100)] 
Start of man-pages-NEXT: Move Changes to Changes.old

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agolsm: Released 6.10
Alejandro Colomar [Wed, 22 Jan 2025 22:11:14 +0000 (23:11 +0100)] 
lsm: Released 6.10

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoChanges: Ready for 6.10 man-pages-6.10
Alejandro Colomar [Wed, 22 Jan 2025 22:03:47 +0000 (23:03 +0100)] 
Changes: Ready for 6.10

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man7/unicode.7: pfix
Alejandro Colomar [Fri, 17 Jan 2025 10:34:09 +0000 (11:34 +0100)] 
man/man7/unicode.7: pfix

Reported-by: Wyatt Carpenter <wyattscarpenter@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoSPONSORS: Publish the sponsors of this project
Alejandro Colomar [Tue, 14 Jan 2025 23:45:31 +0000 (00:45 +0100)] 
SPONSORS: Publish the sponsors of this project

These sponsors started sponsoring this project in 2024-11-01.
Thanks a lot for that!

For anyone interested in sponsoring this project, please contact the
maintainer and/or mailing list.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man7/man-pages.7: Stop telling contributors to write titles in all caps
Jason Yundt [Tue, 14 Jan 2025 21:14:25 +0000 (16:14 -0500)] 
man/man7/man-pages.7: Stop telling contributors to write titles in all caps

Recently, I submitted my first patch to the Linux man-pages project.  In
my patch, I had created a new manual page.  On the manual page’s title
line, I had written the title of my new page in all caps because
man-pages(7) said that I should write it that way.  It turns out that
man-pages(7) was wrong and that the title on the title line should have
matched the title in the manual page’s filename [1][2].  This commit
corrects man-pages(7) so that it does not tell contributors to use all
caps when writing titles on title lines.

Link: [1] <https://lore.kernel.org/linux-man/rph24kz36vysoeix4qoxxxcwq3c3fskws2vmxkkgcb2lpits3f@ysm7ug66svzh/T/#mc84250a6634d7f776118879021331001cceccbe5>
Link: [2] <https://lore.kernel.org/linux-man/mog6nnwzwl2dmlrec5b7l76wbxlsnklvdulok644x6o557trib@3zwtoz47r4x3/T/#mf71422d0e159210a7ca2798f2bba50a668e1410e>
Message-ID: <20250114211427.160509-1-jason@jasonyundt.email>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man2/fork.2: Add _exit(2) to example
Tobias Stoeckmann [Mon, 13 Jan 2025 16:40:43 +0000 (17:40 +0100)] 
man/man2/fork.2: Add _exit(2) to example

The _exit(2) function is a better choice for exiting a child in many
cases.  Most prominently it avoids calls of functions registered with
atexit(3) by the parent.

There are valid reasons to call exit(3) and the example is actually one
of them: flush FILE-based output.  Since atexit(3) is never called, we
could just stay with exit(3).

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Message-ID: <tngwcffbrzbfkj6vrxgxpekrp3bzuftdy2mzow56xyfkrcna2w@nbgr2ourerxo>
Link: <https://github.com/shadow-maint/shadow/pull/1171>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
6 months agoman/man3/: SYNOPSIS: Use typeof() to improve readability of function pointer types
Alejandro Colomar [Fri, 13 Dec 2024 13:19:28 +0000 (14:19 +0100)] 
man/man3/: SYNOPSIS: Use typeof() to improve readability of function pointer types

Due to different spacing, I had missed these ones in the previous
commits of this kind.

Suggested-by: Jorenar <dev@jorenar.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>