]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
3 years agostat-struct.3: New link to system_data_types(7)
Alejandro Colomar [Mon, 24 May 2021 07:35:26 +0000 (09:35 +0200)] 
stat-struct.3: New link to system_data_types(7)

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: G. Branden Robinson <g.branden.robinson@gmail.com>
3 years agostat.2, system_data_types.7: Document 'struct stat' in system_data_types(7)
Alejandro Colomar [Mon, 24 May 2021 07:32:12 +0000 (09:32 +0200)] 
stat.2, system_data_types.7: Document 'struct stat' in system_data_types(7)

Move the definition of the struct present in stat(2), and put
there a reference to stat-struct(3) instead.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: G. Branden Robinson <g.branden.robinson@gmail.com>
3 years agopacket.7: add description of zero protocol for socket
Grzegorz Szpetkowski [Tue, 25 Jan 2022 15:22:17 +0000 (16:22 +0100)] 
packet.7: add description of zero protocol for socket

According to packet(7), whenever raw packet is created by
socket(), it's immediately running, meaning that internal
packet_rcv() handler will be triggered and socket buffer will
begin allocation of sk_buff until sk_rcvbuf limit is reached.

However, by examination of kernel's internal handler
packet_create() it looks that kernel handles case of zero protocol
in a special manner.  When packet_create() is called with arg
protocol = 0, __register_prot_hook is not executed, meaning
running state is still 0 and most notably, packet handler is not
added to kernel list (vide dev_add_pack).

I found this behavior invaluable for solving a subtle issue.  When
process creates raw packet socket to listen for (let's say) all
protocols, but limited to a single network interface, then while
this interface can set by bind, it may to be too late due to
preemption (e.g. if real-time scheduling is used) and/or high-rate
of packets on other interfaces, meaning that undesired packets
(any count) may be pulled into the socket buffer.

The idea is that protocol zero means no packets on receive and an
optional call to bind with nonzero sll_procol will act "as if" the
originating socket API was called with this (nonzero) protocol.

The call to bind(2) is optional.  As an example, if user intends
to treat the socket as Tx-only, then bind(2) may be skipped.

Reported-by: Grzegorz Szpetkowski <gszpetkowski@gmail.com>
Link: linux-man@ <https://lore.kernel.org/linux-man/CAMW=dumhWDu6LdhaQCJMskA4yNRBtOHs4iyrG6TP7xRv28AVWA@mail.gmail.com/>
Cowritten-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by Grzegorz Szpetkowski <gszpetkowski@gmail.com>:

3 years agocapabilities.7: improve internal references
Kir Kolyshkin [Fri, 4 Feb 2022 21:00:21 +0000 (13:00 -0800)] 
capabilities.7: improve internal references

Trying to make this man page easier to navigate.

Fix a few cases of "see above/below" without a specific reference to a
subsection by quoting the subsection name (making it easier to look it up).
Use the same formatting rule as used by some of the other existing
references, i.e. italicise it.

For uniformity, remove words such as "the subsection" and "under", using
"(see|described in) <subsection title> (above|below)" template.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofmemopen.3: wfix
Alejandro Colomar [Fri, 4 Feb 2022 12:41:55 +0000 (13:41 +0100)] 
fmemopen.3: wfix

Fix incorrect identifier.

Reported-by: Lucien Gentis <lucien.gentis@waika9.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofsync.2: ERRORS: Document EINTR
Alejandro Colomar [Tue, 1 Feb 2022 14:42:53 +0000 (15:42 +0100)] 
fsync.2: ERRORS: Document EINTR

Reported-by: Mathnerd314 <mathnerd314.gph@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
3 years agotime.7: tfix
наб [Sat, 29 Jan 2022 22:59:47 +0000 (23:59 +0100)] 
time.7: tfix

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotime.7: tfix
наб [Sat, 29 Jan 2022 22:59:29 +0000 (23:59 +0100)] 
time.7: tfix

"HZ" is the constant, and has nothing to do with the
50 Hz PAL/60 Hz NTSC mains frequencies

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agounits.7: SEE ALSO: Add link to 'The International System of Units'
Alejandro Colomar [Sat, 29 Jan 2022 22:59:40 +0000 (23:59 +0100)] 
units.7: SEE ALSO: Add link to 'The International System of Units'

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
3 years agoman-pages.7: wfix
Alejandro Colomar [Wed, 26 Jan 2022 20:47:53 +0000 (21:47 +0100)] 
man-pages.7: wfix

'clauses' is clearer than 'sentence clauses' in this case; there's
no ambiguity.

Reported-by: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoswapon.2: CONFIG_DEVICE_PRIVATE decreases number of available swap files by 4
Alejandro Colomar [Tue, 25 Jan 2022 18:23:28 +0000 (19:23 +0100)] 
swapon.2: CONFIG_DEVICE_PRIVATE decreases number of available swap files by 4

[Aleksander]:
I noticed that swapon docs are missing some newer information
about CONFIG_DEVICE_PRIVATE that decreases the number of available
swap files.  When it comes to kernel versions that I used
<https://elixir.bootlin.com/linux/v5.14/source/include/linux/swap.h>
and
<https://elixir.bootlin.com/linux/v4.14/source/include/linux/swap.h>
to check when the changes were introduced.

Reported-by: Aleksander Baranowski <alex@euro-linux.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotermios.3: Clarify ONLRET
Simon Branch [Sat, 1 Jan 2022 22:55:23 +0000 (14:55 -0800)] 
termios.3: Clarify ONLRET

While perusing various termios(3) and termios(4) manpages, I
noticed the following inconsistency for ONLRET.  FreeBSD and
NetBSD say this:

   If ONLRET is set, the NL character is assumed to do the
   carriage-return function; the column pointer will be set to 0.

OpenBSD says this:

   If ONLRET is set, NL also performs CR on output, and reset
   current column to 0.

POSIX says this:

   NL performs CR function.

The current Linux manpage says this (!):

   Don't output CR.

Here's a snippet that demonstrates Linux's behavior (tl;dr it's
just like the other operating systems):

   $ stty -icanon -onlcr -icrnl -echo onlret onocr; cat
   this is some text (^J pressed)
                    and some more (^M pressed before additional text)

The first flags (-icanon -onlcr -icrnl -echo), combined with cat,
ensure that our keys are sent directly back to the terminal
emulator without any translation or buffering.  The last two
(ONLRET and ONOCR) are the important ones: ONLRET makes Linux
think that the cursor is at column 0 after the ^J, and ONOCR makes
Linux ignore the following ^M.

Signed-off-by: Simon Branch <simonmbranch@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Pali Rohár <pali@kernel.org>
3 years agostrsep.3: Minor tweaks to наб's patch
Alejandro Colomar [Tue, 25 Jan 2022 16:14:54 +0000 (17:14 +0100)] 
strsep.3: Minor tweaks to наб's patch

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agostrsep.3: port strtok(3) example
наб [Mon, 24 Jan 2022 22:43:17 +0000 (23:43 +0100)] 
strsep.3: port strtok(3) example

Each time I use strsep I want something like this;
this serves to snappily highlight the programming model,
esp. in contrast to strtok_r ‒ I elided the long
(and, frankly, gratuitous, even there) argv explanation
‒ if you need it, you can read the original
(or the usage string, or the seven-line main)

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agostrtok.3: fix \t literal instead of \et in example
наб [Sun, 23 Jan 2022 00:19:31 +0000 (01:19 +0100)] 
strtok.3: fix \t literal instead of \et in example

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agostrsep.3: tfix
наб [Sat, 22 Jan 2022 23:52:54 +0000 (00:52 +0100)] 
strsep.3: tfix

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomemfd_secret.2: mention ENOSYS is also returned when secretmem_enable=0
наб [Sun, 23 Jan 2022 12:36:42 +0000 (13:36 +0100)] 
memfd_secret.2: mention ENOSYS is also returned when secretmem_enable=0

Ref: https://lore.kernel.org/all/20210518072034.31572-5-rppt@kernel.org/
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomemfd_secret.2: mention that it inhibits hibernation
наб [Sun, 23 Jan 2022 12:34:28 +0000 (13:34 +0100)] 
memfd_secret.2: mention that it inhibits hibernation

Ref: https://lore.kernel.org/all/20210518072034.31572-6-rppt@kernel.org/
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years ago.gitignore, Makefile, scripts/bash_aliases: Adapt to the recently added section 0...
Alejandro Colomar [Sun, 23 Jan 2022 14:38:07 +0000 (15:38 +0100)] 
.gitignore, Makefile, scripts/bash_aliases: Adapt to the recently added section 0 (man0/)

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agosysexits.h.0: New page documenting <sysexits.h>
Alejandro Colomar [Sun, 23 Jan 2022 14:22:55 +0000 (15:22 +0100)] 
sysexits.h.0: New page documenting <sysexits.h>

Based on OpenBSD's and FreeBSD's sysexits(3) manual pages,
and on the <sysexits.h> file itself.

Relevant differences from those manual pages:
- Rewritten using man(7) macros.
- Since this documents a header file (similar to <limits.h>), use
  section 0, as the man-pages-posix project does (limits.h(0p)).
- Remove a statement that these error codes are non-portable
  and should not be used.  Instead, it's more clarifying to say
  that these are not in POSIX, but are on the BSDs.  Let users
  decide what to do based on that.  Probably, it's portable enough
  these days.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoepoll_ctl.2: replace input flag footnotes with a list section
наб [Thu, 13 Jan 2022 15:14:10 +0000 (16:14 +0100)] 
epoll_ctl.2: replace input flag footnotes with a list section

This is shorter, clearly separates the events from the flags,
and more consistent (cf. EPOLLEXCLUSIVE which has a different message
than the rest)

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoepoll_wait.2: epoll_pwait2(2) wrapper added to glibc
Alejandro Colomar [Thu, 13 Jan 2022 12:49:17 +0000 (13:49 +0100)] 
epoll_wait.2: epoll_pwait2(2) wrapper added to glibc

glibc's wrapper has the already documented prototype, so no need
to change anything.  Just remove the FIXME.

Reported-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
3 years agoglob.3: srcfix
наб [Tue, 11 Jan 2022 18:28:27 +0000 (19:28 +0100)] 
glob.3: srcfix

For consistency: this is the only non-false-positive for ", and",
which now reads:
  $ git grep '", and"'
  man2/ioctl_tty.2:.BR "#include <termios.h>" "      /* Definition of " CLOCAL ", and"

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopkeys.7: wfix
наб [Tue, 11 Jan 2022 18:27:42 +0000 (19:27 +0100)] 
pkeys.7: wfix

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopersonality.2: WHOLE_SECONDS never did anything
наб [Mon, 10 Jan 2022 18:53:42 +0000 (19:53 +0100)] 
personality.2: WHOLE_SECONDS never did anything

git log -SWHOLE_SECONDS on a unified pre-2.6 linux repository
reveals the following three releases:
  Author: Andrew Morton <akpm@osdl.org>
  Date:   Sun Aug 31 04:30:04 2003 -0700

      [PATCH] abi doc update

      From: <ffrederick@prov-liege.be>

      Update the abi sysctl documentation.

  Author: Linus Torvalds <torvalds@athlon.transmeta.com>
  Date:   Mon Feb 4 20:17:27 2002 -0800

      v2.4.9.7 -> v2.4.9.8

        - Christoph Hellwig: clean up personality handling a bit
        - Robert Love: update sysctl/vm documentation
        - make the three-argument (that everybody hates) "min()" be "min_t()",
        and introduce a type-anal "min()" that complains about arguments of
        different types.

  Author: Linus Torvalds <torvalds@linuxfoundation.org>
  Date:   Fri Nov 23 15:09:30 2007 -0500

      Import 1.1.14

1.1.14 adds personality.h:
  diff --git a/include/linux/personality.h b/include/linux/personality.h
  new file mode 100644
  index 0000000000..714a5a66b5
  --- /dev/null
  +++ b/include/linux/personality.h
  @@ -0,0 +1,12 @@
  +/* Flags for bug emulation. These occupy the top three bytes. */
  +#define STICKY_TIMEOUTS                0x8000000
  +#define WHOLE_SECONDS          0x4000000
  +
  +/* Personality types. These go in the low byte. */
  +#define PER_MASK               (0x00ff)
  +#define PER_LINUX              (0x0000)
  +#define PER_SVR4               (0x0001 | STICKY_TIMEOUTS)
  +#define PER_SVR3               (0x0002 | STICKY_TIMEOUTS)
  +#define PER_SCOSVR3            (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
  +#define PER_WYSEV386           (0x0004 | STICKY_TIMEOUTS)
  +#define PER_ISCR4              (0x0005 | STICKY_TIMEOUTS)

2.4.9.8 shuffles it around with no substantial changes
(hunk enhanced to show texture):
  diff --git a/include/linux/personality.h b/include/linux/personality.h
  index 58cab509e3..230d394603 100644
  --- a/include/linux/personality.h
  +++ b/include/linux/personality.h
  @@ -1,68 +1,126 @@
  -/* Flags for bug emulation. These occupy the top three bytes. */
  -#define STICKY_TIMEOUTS                0x4000000
  -#define WHOLE_SECONDS          0x2000000
  -#define ADDR_LIMIT_32BIT       0x0800000

  -/* Personality types. These go in the low byte. Avoid using the top bit,
  - * it will conflict with error returns.
  +/*
  + * Flags for bug emulation.
  + *
  + * These occupy the top three bytes.
    */
  -#define PER_MASK               (0x00ff)
  -#define PER_LINUX              (0x0000)
  -#define PER_LINUX_32BIT                (0x0000 | ADDR_LIMIT_32BIT)
  -#define PER_SVR4               (0x0001 | STICKY_TIMEOUTS)
  -#define PER_SVR3               (0x0002 | STICKY_TIMEOUTS)
  -#define PER_SCOSVR3            (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
  -#define PER_WYSEV386           (0x0004 | STICKY_TIMEOUTS)
  -#define PER_ISCR4              (0x0005 | STICKY_TIMEOUTS)
  -#define PER_BSD                        (0x0006)
  -#define PER_SUNOS              (PER_BSD | STICKY_TIMEOUTS)
  -#define PER_XENIX              (0x0007 | STICKY_TIMEOUTS)
  -#define PER_LINUX32            (0x0008)
  -#define PER_IRIX32              (0x0009 | STICKY_TIMEOUTS) /* IRIX5 32-bit     */
  -#define PER_IRIXN32             (0x000a | STICKY_TIMEOUTS) /* IRIX6 new 32-bit */
  -#define PER_IRIX64              (0x000b | STICKY_TIMEOUTS) /* IRIX6 64-bit     */
  -#define PER_RISCOS             (0x000c)
  -#define PER_SOLARIS            (0x000d | STICKY_TIMEOUTS)
  -
  -/* Description of an execution domain - personality range supported,
  - * lcall7 syscall handler, start up / shut down functions etc.
  - * N.B. The name and lcall7 handler must be where they are since the
  - * offset of the handler is hard coded in kernel/sys_call.S.
  +enum {
  +       MMAP_PAGE_ZERO =        0x0100000,
  +       ADDR_LIMIT_32BIT =      0x0800000,
  +       SHORT_INODE =           0x1000000,
  +       WHOLE_SECONDS =         0x2000000,
  +       STICKY_TIMEOUTS =       0x4000000,
  +};
  +
  +/*
  + * Personality types.
  + *
  + * These go in the low byte.  Avoid using the top bit, it will
  + * conflict with error returns.
  + */
  +enum {
  +       PER_LINUX =             0x0000,
  +       PER_LINUX_32BIT =       0x0000 | ADDR_LIMIT_32BIT,
  +       PER_SVR4 =              0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
  +       PER_SVR3 =              0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
  +       PER_SCOSVR3 =           0x0003 | STICKY_TIMEOUTS |
  +                                        WHOLE_SECONDS | SHORT_INODE,
  +       PER_OSR5 =              0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
  +       PER_WYSEV386 =          0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
  +       PER_ISCR4 =             0x0005 | STICKY_TIMEOUTS,
  +       PER_BSD =               0x0006,
  +       PER_SUNOS =             0x0006 | STICKY_TIMEOUTS,
  +       PER_XENIX =             0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
  +       PER_LINUX32 =           0x0008,
  +       PER_IRIX32 =            0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
  +       PER_IRIXN32 =           0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
  +       PER_IRIX64 =            0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
  +       PER_RISCOS =            0x000c,
  +       PER_SOLARIS =           0x000d | STICKY_TIMEOUTS,
  +       PER_UW7 =               0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
  +       PER_UW7 =               0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
  +       PER_MASK =              0x00ff,
  +};

And the ABI doc creates Documentation/sysctl/abi.txt, noting
  +defhandler_coff:
  +defined value :
  +PER_SCOSVR3
  +0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE

The same log of mainline reveals, apart from the original 2.6.12-rc2
import:
  1. 607ca46e97a1b6594b29647d98a32d545c24bdff ("UAPI: (Scripted)
     Disintegrate include/linux") ‒ include/linux/{=> uapi/}personality.h
  2. 53b9537509654a6267c3f56b4d2e7409b9089686 ("docs: sysctl: convert to
     ReST") ‒ Documentation/sysctl/abi.{rst => txt}
  3. 9f35cf8bd7e3347b0679c3f9b5e0bc5493925a1f ("docs: rewrite
     admin-guide/sysctl/abi.rst") ‒ rewrites
     Documentation/admin-guide/sysctl/abi.rst entirely, removing all
     personality bits ("all the existing entries are no longer present,
     so this removes them;")

Current mainline contains WHOLE_SECONDS thrice:
  include/uapi/linux/personality.h:       WHOLE_SECONDS =         0x2000000,
  include/uapi/linux/personality.h-       PER_SCOSVR3 =           0x0003 | STICKY_TIMEOUTS |
  include/uapi/linux/personality.h:                                        WHOLE_SECONDS | SHORT_INODE,
  include/uapi/linux/personality.h:       PER_OSR5 =              0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,

It never did anything.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Jakub Wilk <jwilk@jwilk.net>
3 years agostrtok.3: Fix j/str1 declaration
Stephen Kitt [Sat, 8 Jan 2022 15:43:04 +0000 (16:43 +0100)] 
strtok.3: Fix j/str1 declaration

    for (int j = 1, str1 = argv[1]; ...

declares two variables of type int, j and str1; the pre-existing
char * str1 isn't used. This causes compiler warnings. Declaring j
outside the loop fixes everything.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopkeys.7: Rely on the glibc implementations
Stephen Kitt [Sat, 8 Jan 2022 15:43:03 +0000 (16:43 +0100)] 
pkeys.7: Rely on the glibc implementations

glibc 2.27 added implementations of pkey_set(), pkey_mprotect(),
pkey_alloc(), and pkey_free(); rely on those instead of defining them
in the example. wrpkru() is only used in pkey_set() and can be removed
too (it's the internal-use-only pkey_write() in glibc).

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopkeys.7: Update the example to match glibc
Stephen Kitt [Sat, 8 Jan 2022 15:43:02 +0000 (16:43 +0100)] 
pkeys.7: Update the example to match glibc

glibc 2.27 introduced support for the pkeys functions, but the glibc
versions don't match those declared in the example. Update the example
to match glibc, and avoid declaring the functions if glibc is new
enough.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomq_notify.3: Add signal.h for SIGEV_ constants
Stephen Kitt [Sat, 8 Jan 2022 15:43:00 +0000 (16:43 +0100)] 
mq_notify.3: Add signal.h for SIGEV_ constants

The example program needs signal.h to build correctly, since the
SIGEV_ constants are defined through signal.h; also document that in
the synopsis.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agonewlocale.3: Use LC_GLOBAL_LOCALE, not ..._HANDLE
Stephen Kitt [Fri, 7 Jan 2022 16:46:18 +0000 (17:46 +0100)] 
newlocale.3: Use LC_GLOBAL_LOCALE, not ..._HANDLE

LC_GLOBAL_HANDLE has never existed; the locale object handle to use to
refer to the global locale determined by setlocale(3) is
LC_GLOBAL_LOCALE. See uselocale(3) for details.

[Jakub]:
$ cc -Wall newlocale-example.c
newlocale-example.c: In function 'main':
newlocale-example.c:67:15: error: 'LC_GLOBAL_HANDLE' undeclared (first use in this function); did you mean 'LC_GLOBAL_LOCALE'?
   67 |     uselocale(LC_GLOBAL_HANDLE);    /* So 'loc' is no longer in use */
      |               ^~~~~~~~~~~~~~~~
      |               LC_GLOBAL_LOCALE
newlocale-example.c:67:15: note: each undeclared identifier is reported only once for each function it appears in

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Jakub Wilk <jwilk@jwilk.net>
3 years agoinet.3: Switch to _DEFAULT_SOURCE in the example
Stephen Kitt [Fri, 7 Jan 2022 16:46:15 +0000 (17:46 +0100)] 
inet.3: Switch to _DEFAULT_SOURCE in the example

_BSD_SOURCE has been obsolete for long enough that it seems reasonable
to update the example program to use _DEFAULT_SOURCE instead.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoseccomp.2: Use syscall() in the example code
Stephen Kitt [Fri, 7 Jan 2022 16:46:14 +0000 (17:46 +0100)] 
seccomp.2: Use syscall() in the example code

Since seccomp() doesn't exist in glibc, avoid relying on it, and use
syscall() instead. This updates the example program to match the
documentation, which was updated in commit 5945cd7bd3c3 ("seccomp.2:
Use syscall(SYS_...); for system calls without a wrapper").

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotee.2: ffix
наб [Mon, 3 Jan 2022 17:03:32 +0000 (18:03 +0100)] 
tee.2: ffix

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotee.2: Remove unnecessary else
Alejandro Colomar [Mon, 3 Jan 2022 17:19:29 +0000 (18:19 +0100)] 
tee.2: Remove unnecessary else

Both continue and exit(3) jump out of the normal flow, so there's
no need for an else.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotee.2: always fail after perror() in example
наб [Mon, 3 Jan 2022 17:03:56 +0000 (18:03 +0100)] 
tee.2: always fail after perror() in example

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotee.2: use for(;;) instead of do{}while(1)
наб [Mon, 3 Jan 2022 17:03:44 +0000 (18:03 +0100)] 
tee.2: use for(;;) instead of do{}while(1)

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotee.2: use proper types in example
наб [Mon, 3 Jan 2022 17:03:32 +0000 (18:03 +0100)] 
tee.2: use proper types in example

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agosystem_data_types.7: note struct timespec::tv_nsec type for x32 and portability
наб [Mon, 6 Dec 2021 23:31:38 +0000 (00:31 +0100)] 
system_data_types.7: note struct timespec::tv_nsec type for x32 and portability

There are three files that govern userspace struct timespec on glibc:
1. bits/wordsize.h, defining:
   (a) __WORDSIZE to 32 on ILP32 and 64 on LP64
   (b) on x32: __SYSCALL_WORDSIZE to 64
2. bits/timesize.h, defining
   (a) __TIMESIZE to __WORDSIZE, except on x32 where it's 64
3. bits/types/struct_timespec.h, declaring struct timespec as:
     struct timespec
     {
      __time_t tv_sec;      /* Seconds.  */
     #if __WORDSIZE == 64 \
      || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
      || __TIMESIZE == 32
      __syscall_slong_t tv_nsec;    /* Nanoseconds.  */
     #else
     # if __BYTE_ORDER == __BIG_ENDIAN
      int: 32;           /* Padding.  */
      long int tv_nsec;  /* Nanoseconds.  */
     # else
      long int tv_nsec;  /* Nanoseconds.  */
      int: 32;           /* Padding.  */
     # endif
     #endif
     };
   this has two side-effects: struct timespec
   (a) is always sizeof==time_t+8, and
   (b) has tv_nsec as __syscall_slong_t
       *and* !is_same<__syscall_slong_t, long>
       if using LP64 syscalls on an ILP32 system, i.e. on x32.

This means, that the simplified
  struct timespec {
      time_t  tv_sec;  /* Seconds */
      long    tv_nsec; /* Nanoseconds [0 .. 999999999] */
  };
declaration is *invalid* for x32,
where struct timespec::tv_nsec is an int64_t (long long).

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotee.2: ffix
наб [Mon, 3 Jan 2022 15:33:53 +0000 (16:33 +0100)] 
tee.2: ffix

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoioctl_tty.2: Update the section number of ldattach
Masatake YAMATO [Fri, 31 Dec 2021 08:36:07 +0000 (17:36 +0900)] 
ioctl_tty.2: Update the section number of ldattach

The man page for ldattach was added to util-linux(-ng?)
as a part of the section 8, not the section 1.

    commit 1e8d11c459ae93a4d8d7976a8530ae5198206a26
    Author: Tilman Schmidt <tilman@imap.cc>
    Date:   Mon Mar 10 14:20:26 2008 +0100

ldattach: new command

Add an ldattach(8) utility program similar to the one in OpenBSD.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoencrypt.3: encrypt/encrypt_r, not crypt/crypt_r were deleted from 2.28
Huang Pei [Thu, 30 Dec 2021 09:42:51 +0000 (17:42 +0800)] 
encrypt.3: encrypt/encrypt_r, not crypt/crypt_r were deleted from 2.28

See sysdeps/unix/sysv/linux/riscv/rv{32,64}/libcrypt.abilist from
glibc

[alx]:

Confirmed.  See the following:

$ git checkout glibc-2.28
Previous HEAD position was 23158b08a0 Update for 2.27 release
HEAD is now at 3c03baca37 Update NEWS, version.h, and features.h for glibc 2.28.
$
$ grep_glibc_prototype crypt
crypt/crypt.h:36:
extern char *crypt (const char *__phrase, const char *__salt)
     __THROW __nonnull ((1, 2));
posix/unistd.h:1124:
extern char *crypt (const char *__key, const char *__salt)
     __THROW __nonnull ((1, 2));
$
$ grep_glibc_prototype encrypt
$
$ git checkout glibc-2.27
Previous HEAD position was 3c03baca37 Update NEWS, version.h, and features.h for glibc 2.28.
HEAD is now at 23158b08a0 Update for 2.27 release
$
$ grep_glibc_prototype crypt
crypt/crypt.h:32:
extern char *crypt (const char *__key, const char *__salt)
     __THROW __nonnull ((1, 2));
posix/unistd.h:1126:
extern char *crypt (const char *__key, const char *__salt)
     __THROW __nonnull ((1, 2));
$
$ grep_glibc_prototype encrypt
crypt/crypt.h:40:
extern void encrypt (char *__glibc_block, int __edflag)
     __THROW __nonnull ((1));
posix/unistd.h:1131:
extern void encrypt (char *__glibc_block, int __edflag)
     __THROW __nonnull ((1));
$

Signed-off-by: Huang Pei <huangpei@loongson.cn>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoprintf.3: Add VERSIONS
Alejandro Colomar [Wed, 22 Dec 2021 18:11:58 +0000 (19:11 +0100)] 
printf.3: Add VERSIONS

CONFORMING TO contained info that should be in VERSIONS.
Add a new VERSIONS section and move that text.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoprintf.3: Document %#m as strerrorname_np(errno)
Alejandro Colomar [Wed, 22 Dec 2021 18:00:20 +0000 (19:00 +0100)] 
printf.3: Document %#m as strerrorname_np(errno)

Reported-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: libc-alpha@sourceware.org
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
3 years agoaccess.2: Document EPERM error code
Alejandro Colomar [Sat, 18 Dec 2021 18:44:55 +0000 (19:44 +0100)] 
access.2: Document EPERM error code

[Todd]:

If a file/directory has the immutable flag set, access/faccessat
will return EPERM if write access is requested.  This is not
currently documented, presumably because it is Linux-specific
(though BSD has similar behavior that is documented).  Perhaps
something like the following in the ERRORS section.

EPERM Write permission was requested and pathname has the
immutable flag set.  (See also ioctl_iflags(2).)

Also perhaps add ioctl_iflags(2) to the SEE ALSO section.

This came up in reference to:
<https://github.com/sudo-project/sudo/issues/122>

Reported-by: "Todd C. Miller" <Todd.Miller@sudo.ws>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomount_setattr.2, proc.5, netlink.7, tcp.7: tfix
Samanta Navarro [Wed, 24 Nov 2021 11:59:27 +0000 (11:59 +0000)] 
mount_setattr.2, proc.5, netlink.7, tcp.7: tfix

Typos found with codespell.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopthread_cancel.3, pthread_cleanup_push_defer_np.3, pthread_setcancelstate.3, pthread_...
Samanta Navarro [Wed, 24 Nov 2021 11:58:58 +0000 (11:58 +0000)] 
pthread_cancel.3, pthread_cleanup_push_defer_np.3, pthread_setcancelstate.3, pthread_testcancel.3, pthreads.7: tfix

Changed cancellation to cancelation.

Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agokcmp.2: still depends on kconfig
Jann Horn [Wed, 8 Dec 2021 23:44:33 +0000 (00:44 +0100)] 
kcmp.2: still depends on kconfig

The manpage claims that kcmp() is now available unconditionally. That's
not true; from kernel/Makefile:

    obj-$(CONFIG_KCMP) += kcmp.o

This new Kconfig flag is forced on by CONFIG_CHECKPOINT_RESTORE as
before, but also by CONFIG_DRM, which means that pretty much any kernel
built to support desktop systems will implicitly have it available.

But if you compiled some kind of server/embedded kernel without DRM and
without CHECKPOINT_RESTORE, you'd have to flip on the expert config
option to get KCMP.

Signed-off-by: Jann Horn <jannh@google.com>
[alx: semantic newlines]
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agosystem_data_types.7: timespec: Add tv_nsec range to comment
наб [Mon, 6 Dec 2021 20:12:09 +0000 (21:12 +0100)] 
system_data_types.7: timespec: Add tv_nsec range to comment

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoMany pages: replace in-line struct timespec declarations with "timespec(3) structure...
наб [Mon, 6 Dec 2021 20:12:02 +0000 (21:12 +0100)] 
Many pages: replace in-line struct timespec declarations with "timespec(3) structure" references

Also stripped "as specified in <time.h>" from clock_getres.2,
as it already lives in <time.h>.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomadvise.2: tfix
Matheus Tavares [Fri, 3 Dec 2021 17:28:07 +0000 (14:28 -0300)] 
madvise.2: tfix

Add a missing period.

Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agogetpwnam.3: EXAMPLES: Fix signedness
Alejandro Colomar [Tue, 23 Nov 2021 11:16:43 +0000 (12:16 +0100)] 
getpwnam.3: EXAMPLES: Fix signedness

sysconf(3) returns a long.  Since it can return -1 (and we're
making use of that value), we can't use size_t for bufsize.
Use long.

Link: <https://bugzilla.kernel.org/show_bug.cgi?id=215097>
Reported-by: Fabian <fabian@ritter-vogt.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoinit_module.2: Add ETXTBSY error for finit_module
Yang Xu [Tue, 23 Nov 2021 00:59:09 +0000 (08:59 +0800)] 
init_module.2: Add ETXTBSY error for finit_module

Since kernel commit[1], finit_module fails with ETXTBSY error if fd has write permission.
Since kernel commit[2], finit_module fails with EBADF error if fd doesn't have read permission.

So we can use read-write permission to trigger ETXTBSY error all the time since linux 4.7.

[1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=39d637af
[2]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=032146cd

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoquotactl.2: Add buggy version for Q_XQUOTARM ioctl
Yang Xu [Mon, 15 Nov 2021 02:26:07 +0000 (10:26 +0800)] 
quotactl.2: Add buggy version for Q_XQUOTARM ioctl

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopthread_atfork.3: wfix.
Elliott Hughes [Tue, 9 Nov 2021 22:20:32 +0000 (14:20 -0800)] 
pthread_atfork.3: wfix.

Clarify that the pthread_atfork() callback list is a global, not
per-thread.

The use of "this thread" implied to some readers that pthread_atfork()
maintained per-thread lists of callbacks. Given that the next sentence
already explains that the callbacks are run in the context of the thread
that calls fork(), I actually think it would be fine not to mention
threads at all in the earlier sentence, but for now I've gone with what
I think was intended to be written.

This patch also attempts to clarify other references to "thread",
and fixes a trivial typo "form" instead of "fork".

Signed-off-by: Elliott Hughes <enh@google.com>
Cc: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agommap.2: ENOMEM possible when exceeding VA space
Topi Miettinen [Thu, 11 Nov 2021 18:04:17 +0000 (20:04 +0200)] 
mmap.2: ENOMEM possible when exceeding VA space

A bit surprisingly, mmap(2) returns ENOMEM when the virtual address
space of the CPU is exceeded.

The expectation could be EINVAL instead ("We don't like _addr_,
length, or offset (e.g., they are _too large_, or not aligned on a
page boundary)").

This is demonstrated with the following program:

 #include <stdio.h>
 #include <sys/mman.h>

 int main(void) {
  for (int i = 12; i < 64; i++) {
void *addr = mmap((void *)(1UL << i), 4096, PROT_NONE,
  MAP_ANON | MAP_FIXED_NOREPLACE | MAP_PRIVATE,
  -1, 0);
if (addr == MAP_FAILED)
fprintf(stderr, "mmap %lx: %m\n", (1UL << i));
continue;
munmap(addr, 4096);
}
 }

It gives the following output when running on CPU with 48 bit VA
space:

mmap 800000000000: Cannot allocate memory
mmap 1000000000000: Cannot allocate memory
mmap 2000000000000: Cannot allocate memory
mmap 4000000000000: Cannot allocate memory
mmap 8000000000000: Cannot allocate memory
mmap 10000000000000: Cannot allocate memory
mmap 20000000000000: Cannot allocate memory
mmap 40000000000000: Cannot allocate memory
mmap 80000000000000: Cannot allocate memory
mmap 100000000000000: Cannot allocate memory
mmap 200000000000000: Cannot allocate memory
mmap 400000000000000: Cannot allocate memory
mmap 800000000000000: Cannot allocate memory
mmap 1000000000000000: Cannot allocate memory
mmap 2000000000000000: Cannot allocate memory
mmap 4000000000000000: Cannot allocate memory
mmap 8000000000000000: Cannot allocate memory

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofanotify_init.2: Minor tweaks to Matthew's patch
Alejandro Colomar [Mon, 22 Nov 2021 16:54:48 +0000 (17:54 +0100)] 
fanotify_init.2: Minor tweaks to Matthew's patch

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Cc: Amir Goldstein <amir73il@gmail.com>
3 years agofanotify_init.2: Document kernel commits
Amir Goldstein [Sat, 20 Nov 2021 17:12:53 +0000 (19:12 +0200)] 
fanotify_init.2: Document kernel commits

Document the kernel commits that added support for FAN_REPORT_DIR_FID
and FAN_REPORT_NAME.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofanotify_mark.2: Update w.r.t tmpfs support
Amir Goldstein [Sat, 20 Nov 2021 17:12:52 +0000 (19:12 +0200)] 
fanotify_mark.2: Update w.r.t tmpfs support

tmpfs can be watched with FAN_REPORT_FID since kernel v5.13.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofanotify_init.2, fanotify_mark.2, fanotify.7: Configurable limits
Amir Goldstein [Sat, 20 Nov 2021 17:12:51 +0000 (19:12 +0200)] 
fanotify_init.2, fanotify_mark.2, fanotify.7: Configurable limits

Update documentation about the new configurable fanotify limits
that will be available from Linux kernel 5.13.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofanotify_init.2, fanotify_mark.2: Document unprivileged listener
Matthew Bobrowski [Sat, 20 Nov 2021 17:12:50 +0000 (19:12 +0200)] 
fanotify_init.2, fanotify_mark.2: Document unprivileged listener

Document the limited fanotify functionality that will be available for
unprivileged users from kernel v5.13.

Signed-off-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agobash_aliases: grep_*(): Optimize
Alejandro Colomar [Sun, 14 Nov 2021 13:54:24 +0000 (14:54 +0100)] 
bash_aliases: grep_*(): Optimize

Using grep first to reduce the files on which pcregrep is run
optimizes considerably the performance of these functions.

If a file doesn't contain the name of a function,
which can easily be checked with grep,
it won't possibly contain the function prototype or definition,
which is much slower to search,
since it implies multiline pcregrep search.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoman-pages.7: Add phrasal semantic newlines advise
Alejandro Colomar [Fri, 12 Nov 2021 21:38:11 +0000 (22:38 +0100)] 
man-pages.7: Add phrasal semantic newlines advise

Brian W. Kernighan, 1974 [UNIX For Beginners]:

[
Hints for Preparing Documents

Most documents go through several versions
(always more than you expected)
before they are finally finished.
Accordingly,
you should do whatever possible
to make the job of changing them easy.

First,
when you do the purely mechanical operations of typing,
type so subsequent editing will be easy.
Start each sentence on a new line.
Make lines short,
and break lines at natural places,
such as after commas and semicolons,
rather than randomly.
Since most people change documents
by rewriting phrases and
adding, deleting and rearranging sentences,
these precautions simplify any editing you have to do later.
]

He mentioned phrases,
and they are indeed commonly the operands of patches
(see this patch's changes (the second part) as an example),
so they make for a much better breaking point than random
within a clause that is too long to fit a line.

The downside is that they are more difficult to automatically spot
than clause breaks (which tend to have associated punctuation).
But we are humans writing patches,
not machines,
and therefore we should be able to decide and detect them better.

Link: <https://rhodesmill.org/brandon/2012/one-sentence-per-line/>
Cc: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoman-pages.7: Update nonbreaking space advice
G. Branden Robinson [Fri, 12 Nov 2021 21:50:14 +0000 (08:50 +1100)] 
man-pages.7: Update nonbreaking space advice

* Advise usage of \~ escape instead of \SPACE; the former, a groff
  extension from circa 1990, has been supported by Heirloom Doctools
  troff since 2005 and by mandoc since 2019.  The advantage is that
  \~ is an _adjustable_ non-breaking space, so it will typeset
  non-jarringly both in .EX/.EE examples when filling is off, and in
  normal running text (which is filled).

See linux-man@ list discussion at
<https://lore.kernel.org/linux-man/\
20210729115508.pt6btsqd7g5tuhg6@localhost.localdomain/> and follow-ups.

Signed-off-by: G. Branden Robinson <g.branden.robinson@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotcp.7: Minor tweaks to Wei's patch
Alejandro Colomar [Fri, 12 Nov 2021 20:48:57 +0000 (21:48 +0100)] 
tcp.7: Minor tweaks to Wei's patch

- wsfix
- Boldface literals (see groff_man(7)).
- Replace '\ ' by \~, per Branden's advise.
- Use phrasal semantic newlines.
- Put '...' in a C comment, to avoid interfering with groff.
  It has the side effect that the code example is pure C now.
- Remove incorrect trailing '.IP'.

Cc: Wei Wang <weiwan@google.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotcp.7: Add description for TCP_FASTOPEN and TCP_FASTOPEN_CONNECT options
Wei Wang [Fri, 24 Sep 2021 23:54:56 +0000 (16:54 -0700)] 
tcp.7: Add description for TCP_FASTOPEN and TCP_FASTOPEN_CONNECT options

TCP_FASTOPEN socket option was added by:
commit 8336886f786fdacbc19b719c1f7ea91eb70706d4
TCP_FASTOPEN_CONNECT socket option was added by the following patch
series:
commit 065263f40f0972d5f1cd294bb0242bd5aa5f06b2
commit 25776aa943401662617437841b3d3ea4693ee98a
commit 19f6d3f3c8422d65b5e3d2162e30ef07c6e21ea2
commit 3979ad7e82dfe3fb94a51c3915e64ec64afa45c3
Add detailed description for these 2 options.
Also add descriptions for /proc entry tcp_fastopen and tcp_fastopen_key.

Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoman7: unify socket examples
Jeremy Kerr [Thu, 11 Nov 2021 02:03:07 +0000 (10:03 +0800)] 
man7: unify socket examples

The udp, tcp and x25 man pages' synopses list the socket() example as
all bold, but the socket varname should be italicised. This change
unifies these with the example in socket.7

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoquotactl.2: Remove kernel version for Q_XQUOTARM ioctl
Yang Xu [Wed, 20 Oct 2021 01:46:26 +0000 (09:46 +0800)] 
quotactl.2: Remove kernel version for Q_XQUOTARM ioctl

This patch[1] is designed to fix bug for Q_XQUOTARM ioctl not for introduced.
So remove it.

[1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9da93f9b7c

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agolandlock_add_rule.2, landlock_create_ruleset.2, landlock_restrict_self.2, landlock...
Alejandro Colomar [Wed, 3 Nov 2021 14:12:43 +0000 (15:12 +0100)] 
landlock_add_rule.2, landlock_create_ruleset.2, landlock_restrict_self.2, landlock.7: Minor tweaks to Mickaël's patches

- exit(EXIT_FAILURE) instead of return 1, for consistency with the
  rest of the manual pages.
- Use old declarations: variables defined at the top, separate
  from code.  Initialization other than zero doesn't belong there.
- Don't break URIs in weird ways (a trailing slash on a new line
  would be weird).
- Break URIs after the slash; not before.  Per Branden's advise.
- Use uint32_t instead of __u32 in prototypes.
- tfix
- A few semantic newline improvements.
- ffix

Cc: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agolandlock_restrict_self.2: Document new syscall
Mickaël Salaün [Wed, 18 Aug 2021 15:59:31 +0000 (17:59 +0200)] 
landlock_restrict_self.2: Document new syscall

This is an adaptation of
https://www.kernel.org/doc/html/v5.13/userspace-api/landlock.html

Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20210818155931.484070-5-mic@digikod.net
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agolandlock_add_rule.2: Document new syscall
Mickaël Salaün [Wed, 18 Aug 2021 15:59:30 +0000 (17:59 +0200)] 
landlock_add_rule.2: Document new syscall

This is an adaptation of
https://www.kernel.org/doc/html/v5.13/userspace-api/landlock.html

Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20210818155931.484070-4-mic@digikod.net
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agolandlock_create_ruleset.2: Document new syscall
Mickaël Salaün [Wed, 18 Aug 2021 15:59:29 +0000 (17:59 +0200)] 
landlock_create_ruleset.2: Document new syscall

This is an adaptation of
https://www.kernel.org/doc/html/v5.13/userspace-api/landlock.html

Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20210818155931.484070-3-mic@digikod.net
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agolandlock.7: Add a new page to introduce Landlock
Mickaël Salaün [Wed, 18 Aug 2021 15:59:28 +0000 (17:59 +0200)] 
landlock.7: Add a new page to introduce Landlock

From the user point of view, Landlock is a set of system calls enabling
to build and enforce a set of access-control rules.  A ruleset can be
created with landlock_create_ruleset(2), populated with
landlock_add_rule(2) and enforced with landlock_restrict_self(2).  This
man page gives an overview of the whole mechanism.  Details of these
system calls are documented in their respective man pages.

This is an adaptation of
https://www.kernel.org/doc/html/v5.13/userspace-api/landlock.html

Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20210818155931.484070-2-mic@digikod.net
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agosystem.3: It doesn't call fork anymore
Alejandro Colomar [Tue, 2 Nov 2021 09:55:53 +0000 (10:55 +0100)] 
system.3: It doesn't call fork anymore

Reported-by: Michael Kearney <mikekearney85@hotmail.com>
Cc: Adhemerval Zanella <zatrazz@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoquotactl.2: Use correct limits for vfsv1 format
Yang Xu [Wed, 20 Oct 2021 08:33:14 +0000 (16:33 +0800)] 
quotactl.2: Use correct limits for vfsv1 format

According to kernel code and the following patch, the maximum
quota limit setting should be 2^63 -1 instead of 2^64.

[1] <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=7e08da5>

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoioctl.2: SEE ALSO: Add ioctl_ficlone
Benjamin Peterson [Wed, 27 Oct 2021 21:07:32 +0000 (14:07 -0700)] 
ioctl.2: SEE ALSO: Add ioctl_ficlone

Signed-off-by: Benjamin Peterson <benjamin@python.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopow.3: RETURN VALUE: Clarify that -0.0 is a valid underflow result
Alejandro Colomar [Wed, 27 Oct 2021 20:01:41 +0000 (22:01 +0200)] 
pow.3: RETURN VALUE: Clarify that -0.0 is a valid underflow result

The standards are a bit unclear (or I couldn't find it), but
Joseph confirmed that glibc documents this behavior, and
M. Welinder tested that Solaris also behaves in the same way.

Reported-by: M. Welinder <mwelinder@gmail.com>
Bug: 214815 <https://bugzilla.kernel.org/show_bug.cgi?id=214815>
Cc: Joseph Myers <joseph@codesourcery.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopow.3: RETURN VALUE: Reorder special cases as in the standard
Alejandro Colomar [Tue, 26 Oct 2021 11:36:16 +0000 (13:36 +0200)] 
pow.3: RETURN VALUE: Reorder special cases as in the standard

Use the following order:

- Success
- Over/Underflow
- Special cases specified by the standard (in the same order)
- Other special cases not specified by the standard.

This way it's easier to compare this document against the standard
to check for any mistakes or differences.

I also added a comment at the beginning of each case, to more
clearly delimit special cases, with a syntax that is easy to read
(a mix of C, mathematical language, ...).  We may want to use
those as tagged paragraphs.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Cc: M. Welinder <mwelinder@gmail.com>
3 years agoclock_nanosleep.2: tfix CLOCK_BOOTTIME
Melker Narikka [Mon, 25 Oct 2021 18:28:43 +0000 (21:28 +0300)] 
clock_nanosleep.2: tfix CLOCK_BOOTTIME

Signed-off-by: Melker Narikka <meklu@meklu.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agogetgrouplist.3: wfix
Alejandro Colomar [Mon, 25 Oct 2021 19:45:49 +0000 (21:45 +0200)] 
getgrouplist.3: wfix

Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agogetgrouplist.3: Place variable definitions on top of function
Alejandro Colomar [Mon, 25 Oct 2021 19:44:37 +0000 (21:44 +0200)] 
getgrouplist.3: Place variable definitions on top of function

Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotzset.3: tfix
Alejandro Colomar [Thu, 7 Oct 2021 21:21:13 +0000 (23:21 +0200)] 
tzset.3: tfix

Reported-by: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomsgctl.2: tfix
Alejandro Colomar [Thu, 7 Oct 2021 21:10:01 +0000 (23:10 +0200)] 
msgctl.2: tfix

Reported-by: Jayprakash Ray <r.jay3283@gmail.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agotzset.3: ffix
Jakub Wilk [Thu, 7 Oct 2021 09:09:14 +0000 (11:09 +0200)] 
tzset.3: ffix

Use \- for minus sign

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoscripts/bash_aliases: pdfman(): Generalize the tool
Alejandro Colomar [Wed, 6 Oct 2021 14:15:41 +0000 (16:15 +0200)] 
scripts/bash_aliases: pdfman(): Generalize the tool

Accept man(1) syntax, so that the function can open
system manual pages by [optional] section and page name.

As a side effect, this simplifies the invocation of man(1),
which didn't need '-l'.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomount.2: note that mandatory locking is now fully deprecated
Jeff Layton [Sun, 3 Oct 2021 12:23:30 +0000 (08:23 -0400)] 
mount.2: note that mandatory locking is now fully deprecated

This support has been fully removed from the kernel as of v5.15.

Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agofcntl.2: note that mandatory locking is fully deprecated as of v5.15
Jeff Layton [Sun, 3 Oct 2021 12:24:18 +0000 (08:24 -0400)] 
fcntl.2: note that mandatory locking is fully deprecated as of v5.15

Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agounix.7: Add a description for ENFILE.
Kuniyuki Iwashima [Wed, 29 Sep 2021 01:38:41 +0000 (10:38 +0900)] 
unix.7: Add a description for ENFILE.

When creating UNIX domain sockets, the kernel used to return -ENOMEM on
error where it should return -ENFILE.  The behaviour has been wrong since
2.2.4 and fixed in the recent commit f4bd73b5a950 ("af_unix: Return errno
instead of NULL in unix_create1().").

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agomadvise.2: Document MADV_POPULATE_READ and MADV_POPULATE_WRITE
David Hildenbrand [Mon, 23 Aug 2021 12:06:45 +0000 (14:06 +0200)] 
madvise.2: Document MADV_POPULATE_READ and MADV_POPULATE_WRITE

MADV_POPULATE_READ and MADV_POPULATE_WRITE have been merged into
upstream Linux via commit 4ca9b3859dac ("mm/madvise: introduce
MADV_POPULATE_(READ|WRITE) to prefault page tables"), part of v5.14-rc1.

Further, commit eb2faa513c24 ("mm/madvise: report SIGBUS as -EFAULT for
MADV_POPULATE_(READ|WRITE)"), part of v5.14-rc6, made sure that SIGBUS is
converted to -EFAULT instead of -EINVAL.

Let's document the behavior and error conditions of these new madvise()
options.

Acked-by: Pankaj Gupta <pankaj.gupta@ionos.com>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Jann Horn <jannh@google.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Linux API <linux-api@vger.kernel.org>
Cc: linux-mm@kvack.org
Signed-off-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agorpmatch.3: clarify availability to glibc, Fx, and AIX
наб [Sat, 2 Oct 2021 12:18:54 +0000 (14:18 +0200)] 
rpmatch.3: clarify availability to glibc, Fx, and AIX

"On a few other systems" is misleading, implying that it's available on
/this/ system; this is not strictly true, seeing as musl doesn't have it

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agorpmatch.3: clarify first-character-only FUD
наб [Sat, 2 Oct 2021 12:18:44 +0000 (14:18 +0200)] 
rpmatch.3: clarify first-character-only FUD

It's plain not true as-written ‒ locales can and do provide longer matches
(Aramaic has a "አዎን" alternative, for example) ‒ but it's important to
note that (a) this may be an issue and (b) nonetheless this is the right
way to process this

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agosyscalls.2: Remove duplicate mention of landlock_add_rule.
Günther Noack [Sat, 25 Sep 2021 09:08:03 +0000 (11:08 +0200)] 
syscalls.2: Remove duplicate mention of landlock_add_rule.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agosend.2: Add MSG_FASTOPEN flag
Wei Wang [Fri, 17 Sep 2021 04:16:06 +0000 (21:16 -0700)] 
send.2: Add MSG_FASTOPEN flag

MSG_FASTOPEN flag is available since Linux 3.7. Add detailed description
in the manpage according to RFC7413.

Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopacket.7: Minor tweaks to Ralf's patch
Alejandro Colomar [Mon, 20 Sep 2021 19:18:48 +0000 (21:18 +0200)] 
packet.7: Minor tweaks to Ralf's patch

Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agopacket.7: Describe SOCK_PACKET netif name length issues and workarounds.
Ralf Baechle [Thu, 16 Sep 2021 13:38:23 +0000 (15:38 +0200)] 
packet.7: Describe SOCK_PACKET netif name length issues and workarounds.

Describe the issues with SOCK_PACKET possibly truncating network interface
names in results, solutions and possible workarounds.

While the issue is known for a long time it appears to have never been
properly documented is has started to bite software antiques including
the AX.25 userland badly since the introduction of Predictable Network
Interface Names.  So let's document it.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agolistxattr.2: tfix
Alejandro Colomar [Sun, 19 Sep 2021 19:41:46 +0000 (21:41 +0200)] 
listxattr.2: tfix

Reported-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoalloca.3: simplfy malloc(3) suite comparison, note VLAs
наб [Tue, 14 Sep 2021 12:41:27 +0000 (14:41 +0200)] 
alloca.3: simplfy malloc(3) suite comparison, note VLAs

alloca() is, ex definitione, always faster than any allocator that
actually, well, allocates

Like Alejandro noted, VLAs can provide a less-flexible but sometimes
better-suited solution to the same problem class

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoalloca.3: remove GCC faffling from NOTES
наб [Tue, 14 Sep 2021 12:41:22 +0000 (14:41 +0200)] 
alloca.3: remove GCC faffling from NOTES

Chunks of glibc headers have no place in documenting an interface,
and (__builtin_)alloca() is an intrinsic, not code; those days are,
thankfully, long gone

Also, clarify standards behaviour (and remove the (outdated!)
list of cc(1) switches) regarding when alloca() is allowed to not be
ODR-usable

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoalloca.3: clarify reasoning for no error return in BUGS
наб [Tue, 14 Sep 2021 12:41:16 +0000 (14:41 +0200)] 
alloca.3: clarify reasoning for no error return in BUGS

A stack lasts from some high point until it runs off the back
of the pages allocated, making detecting errors impossible,
save for actually trying to access said unallocated page

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agoalloca.3: clarify origins in CONFORMING TO
наб [Tue, 14 Sep 2021 12:41:10 +0000 (14:41 +0200)] 
alloca.3: clarify origins in CONFORMING TO

alloca() is supported by PWB/UNIX[1] (V6) and UNIX/32V[2] (V7),
for the PDP-11 and VAX, respectively; the former trickles into
UNIX System III[3], and the latter into 3BSD[4] and later[5]

1: https://ftp.okass.net/pub/mirror/minnie.tuhs.org/Distributions/USDL/spencer_pwb.tar.gz
   sys/source/s4/util/alloca.s
2: https://ftp.okass.net/pub/mirror/minnie.tuhs.org/Distributions/USDL/32V/32v_usr.tar.gz
   usr/src/libc/sys/alloca.s
3: https://vetusware.com/download/UNIX%20System%20III%20Source%20Code%20SYSIII/?id=11576
4: https://ftp.okass.net/pub/mirror/minnie.tuhs.org/Distributions/UCB/
5: https://archive.org/details/The_CSRG_Archives_CD-ROM_3_August_1998_Marshall_Kirk_McKusick

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
3 years agostrdup.3: drop mention of "the GNU GCC suite"
наб [Tue, 14 Sep 2021 12:40:55 +0000 (14:40 +0200)] 
strdup.3: drop mention of "the GNU GCC suite"

str[n]dupa() are available on every modern compiler platform,
incl. Clang, ICC, &c.

By shortening the third paragraph, it now reads
    strdupa() and strndupa() are similar,
    but use alloca(3) to allocate the buffer.
pointing squarely to alloca(3), which is scary enough,
so drop the extraneous warning, too ‒ this clearly points to
"see alloca(3) for the limitations of that allocator".

Plus, it's not like malloc(3) doesn't have its problems, too,
but I don't see those being touted in the first paragraph;
reducing these to the bare minimum,
   strdup() copies into malloc(3) and you can free it with free(3),
   strndup() likewise, but up to n, and
   str[n]dupa() use alloca(3) instead ‒ be wary of what alloca(3) does!
doesn't really make sense ‒ it's obvious that, ex definitione,
alloca(3) suffers from alloca(3) problems and input limits,
just like malloc(3) from the malloc(3) suite's.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>