]> git.ipfire.org Git - thirdparty/man-pages.git/log
thirdparty/man-pages.git
16 months agoshare/mk/: Consistency fixes in copyright lines
Alejandro Colomar [Mon, 18 Mar 2024 15:50:28 +0000 (16:50 +0100)] 
share/mk/: Consistency fixes in copyright lines

Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoshare/mk/: build-html: Skip known errors (in groff-1.23.0)
Alejandro Colomar [Mon, 18 Mar 2024 15:27:49 +0000 (16:27 +0100)] 
share/mk/: build-html: Skip known errors (in groff-1.23.0)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoLICENSES/: Add LGPL-3.0-or-later and LGPL-3.0-linking-exception
Alejandro Colomar [Mon, 18 Mar 2024 15:20:58 +0000 (16:20 +0100)] 
LICENSES/: Add LGPL-3.0-or-later and LGPL-3.0-linking-exception

Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoshare/mk/: Update license
Alejandro Colomar [Mon, 18 Mar 2024 15:19:24 +0000 (16:19 +0100)] 
share/mk/: Update license

Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoshare/mk/: Use grohtml(1) instead of man2html(1)
Alejandro Colomar [Mon, 18 Mar 2024 14:35:10 +0000 (15:35 +0100)] 
share/mk/: Use grohtml(1) instead of man2html(1)

man2html(1) crashes on tzfile(5), and the upstream project is defunct.

Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067022>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Robert Luberda <robert@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoproc_pid_io.5: Move note to CAVEATS
Alejandro Colomar [Mon, 18 Mar 2024 10:00:14 +0000 (11:00 +0100)] 
proc_pid_io.5: Move note to CAVEATS

Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agobpf.2: wfix
Jing Peng [Sun, 17 Mar 2024 23:48:24 +0000 (19:48 -0400)] 
bpf.2: wfix

Signed-off-by: Jing Peng <pj.hades@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoip.7: Some socket options are not supported by SOCK_STREAM
Oliver Crumrine [Sun, 17 Mar 2024 13:55:50 +0000 (09:55 -0400)] 
ip.7: Some socket options are not supported by SOCK_STREAM

It was not made clear in several socket options that they were not
supported by SOCK_STREAM; this patch fixes that.

Socket options not supported by SOCK_STREAM are handled in the
ip_cmsg_recv_offset() function in <net/ipv4/ip_sockglue.c>.  The
function is called for udp sockets, and indirectly by ping and raw
sockets, but not for STREAM sockets, as they don't support these
options.

Link: <https://lore.kernel.org/linux-man/ejhphmjh74ebtk4br3id66f27a4yoh4aukrcz7m6dp7acsu6zr@crtueyadqzmp/T/#mb298ac7f71a348d1e6b423cfa32bfad9c28efa40>
Link: <https://lore.kernel.org/linux-man/ejhphmjh74ebtk4br3id66f27a4yoh4aukrcz7m6dp7acsu6zr@crtueyadqzmp/T/#u>
Signed-off-by: Oliver Crumrine <ozlinuxc@gmail.com>
Cc: Peter Seiderer <ps.report@gmx.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoproc_pid_io.5: Dewafflify
наб [Sun, 17 Mar 2024 15:37:52 +0000 (16:37 +0100)] 
proc_pid_io.5: Dewafflify

This page copies verbatim the contents of
Documentation/filesystems/proc.rst, added wholesale in
commit f9c99463b0cd05603d125c915e2886d55a686b82 ("[PATCH] Documentation
for io-accounting / reporting via procfs") in 2007.

As such, it mirrors the sensibilities of the time ‒
writing "successful read returns" as "data pulled from storage. actually
just the data the process gave to read(). this also means from non-regular
files! whether the data was pulled from storage doesn't matter actually
(obligatory cache mention)"
for the modern reader this is just a lot of waffling
(note also that processes give no data to read()!)
‒ and sensibilities of the sheepish implementer in kernel documentation ‒
"an attempt" for a well-defined kernel behaviour, mentioning the
"current implementation", consistent mentions of specific kernel-internal
caching mechanisms, "the big inaccuracy here".

Re-write to be more useful and less misleading as documentation;
the syscall enumeration is accurate for kernel v6.8, but the sysc? stats
are also bumped by kernel_{read,write}(), which is sometimes used by too
many syscalls in too many scenarios to usefully enumerate.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agoproc_pid_io.5: Stats include children
наб [Sun, 17 Mar 2024 11:01:43 +0000 (12:01 +0100)] 
proc_pid_io.5: Stats include children

This file is like getrusage(2) RUSAGE_SELF + RUSAGE_CHILDREN,
the current wording implies it's like just RUSAGE_SELF.

Compare:
  #include <fcntl.h>
  #include <signal.h>
  #include <string.h>
  #include <sys/wait.h>
  #include <unistd.h>

  void copy() {
    char buf[1024];
    int fd = open("/proc/self/io", 0);
    write(1, buf, read(fd, buf, sizeof(buf)));
    close(fd);
  }

  int main() {
    copy();
    copy();
    if (!fork()) {
    zero:;
      int fd = open("/dev/zero", 0);
      char buf[64 * 1024] = {};
      write(1, buf, 10000);
      for (int i = 0; i < 1000; ++i)
        read(fd, buf, sizeof(buf));
      _exit(0);
    }
    sleep(1);
    copy();
    wait(NULL);
    copy();
    signal(SIGCHLD, SIG_IGN);
    if (!fork())
      goto zero;
    sleep(1);
    copy();
    wait(NULL);
    copy();
  }
yielding
  rchar: 3980
  wchar: 0
  syscr: 9
  syscw: 0
  read_bytes: 2968
  write_bytes: 0
  cancelled_write_bytes: 0

  rchar: 4076
  wchar: 96
  syscr: 10
  syscw: 1
  read_bytes: 2968
  write_bytes: 96
  cancelled_write_bytes: 0

  rchar: 4175
  wchar: 195
  syscr: 11
  syscw: 2
  read_bytes: 2968
  write_bytes: 195
  cancelled_write_bytes: 0

  rchar: 65540276
  wchar: 10296
  syscr: 1012
  syscw: 4
  read_bytes: 2968
  write_bytes: 10296
  cancelled_write_bytes: 0

  rchar: 65540387
  wchar: 10407
  syscr: 1013
  syscw: 5
  read_bytes: 2968
  write_bytes: 10407
  cancelled_write_bytes: 0

  rchar: 65540498
  wchar: 10518
  syscr: 1014
  syscw: 6
  read_bytes: 2968
  write_bytes: 10518
  cancelled_write_bytes: 0

Just s/process/& and its waited-for children/ but re-broken per review.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agotzfile.5: ffix
Alejandro Colomar [Sun, 17 Mar 2024 12:47:28 +0000 (13:47 +0100)] 
tzfile.5: ffix

Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agotzfile.5: Avoid crashing man2html(1)
Alejandro Colomar [Sun, 17 Mar 2024 11:23:25 +0000 (12:23 +0100)] 
tzfile.5: Avoid crashing man2html(1)

Link: <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067022>
Cc: Paul Eggert <eggert@cs.ucla.edu>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: Robert Luberda <robert@debian.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agotzfile.5, tzselect.8, zdump.8, zic.8: Refresh pages
Alejandro Colomar [Sat, 16 Mar 2024 22:04:46 +0000 (23:04 +0100)] 
tzfile.5, tzselect.8, zdump.8, zic.8: Refresh pages

Refreshed from tzdb-2024a.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
16 months agobpf-helpers.7: Refresh page
Alejandro Colomar [Sat, 16 Mar 2024 21:57:05 +0000 (22:57 +0100)] 
bpf-helpers.7: Refresh page

Scripted change:

$ ~/src/linux/linux/6.8/scripts/bpf_doc.py | rst2man > man7/bpf-helpers.7

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agogetgrouplist.3: Use same type in both sides of comparison
Alejandro Colomar [Sat, 16 Mar 2024 01:01:20 +0000 (02:01 +0100)] 
getgrouplist.3: Use same type in both sides of comparison

This removes a warning.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agounix.7: EXAMPLES: server.c: End connection with END
Lili Püspök [Wed, 6 Mar 2024 20:02:47 +0000 (21:02 +0100)] 
unix.7: EXAMPLES: server.c: End connection with END

Client wants to send END while server already closed the connection on
DOWN, so connection is broken instead of the Result = 0 in the sample on
sending a single DOWN.
Now, the server disconnects only on first END. After DOWN, all further
processing of number stops.
Patch does not handle cases of double END sending, multiple clients etc.

Fixes: 15545eb6d7ae ("unix.7: Add example")
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Lili Püspök <poordirtylili@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoprintf.3: Return the number of bytes printed, not characters
Jeremy Baxter [Fri, 15 Mar 2024 01:07:14 +0000 (14:07 +1300)] 
printf.3: Return the number of bytes printed, not characters

From <https://pubs.opengroup.org/onlinepubs/9699919799/functions/printf.html>:

    Upon successful completion, the dprintf(), fprintf(), and printf()
    functions shall return the number of bytes transmitted.

Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=218600>
Reported-by: <quirin.blaeser@freenet.de>
Signed-off-by: Jeremy Baxter <jtbx@disroot.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoutf-8.7: ffix
Alejandro Colomar [Thu, 14 Mar 2024 16:44:12 +0000 (17:44 +0100)] 
utf-8.7: ffix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoutf-8.7: ffix
Samanta Navarro [Thu, 14 Mar 2024 12:22:42 +0000 (12:22 +0000)] 
utf-8.7: ffix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoprintf.h.3head: tfix
Samanta Navarro [Thu, 14 Mar 2024 12:21:50 +0000 (12:21 +0000)] 
printf.h.3head: tfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agogetrusage.2, proc_pid_io.5: Crosslink
наб [Wed, 13 Mar 2024 14:26:54 +0000 (15:26 +0100)] 
getrusage.2, proc_pid_io.5: Crosslink

These serve the same purpose from different perspectives.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agogetrusage.2: proc(5) /proc/pid/stat -> proc_pid_stat(5)
наб [Wed, 13 Mar 2024 14:26:52 +0000 (15:26 +0100)] 
getrusage.2: proc(5) /proc/pid/stat -> proc_pid_stat(5)

Fixes: bbc21bc4dbef ("proc.5, proc_pid_stat.5: Split /proc/PID/stat from proc(5)")
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoproc_pid_io.5: Mention atomicity in atomicity note
наб [Wed, 13 Mar 2024 14:26:50 +0000 (15:26 +0100)] 
proc_pid_io.5: Mention atomicity in atomicity note

And drop "current implementation"
(wording still literal from Documentation/filesystems/proc.rst).
Of course this describes the current implementation.

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoproc_pid_io.5: wfix
наб [Wed, 13 Mar 2024 14:26:48 +0000 (15:26 +0100)] 
proc_pid_io.5: wfix

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoscripts/LinuxManBook/build.sh, share/mk/: Use command variables
Alejandro Colomar [Tue, 12 Mar 2024 17:45:42 +0000 (18:45 +0100)] 
scripts/LinuxManBook/build.sh, share/mk/: Use command variables

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agologb.3: floor(log2(fabs(x))) has rounding errors
Alejandro Colomar [Tue, 12 Mar 2024 17:25:17 +0000 (18:25 +0100)] 
logb.3: floor(log2(fabs(x))) has rounding errors

Link: <https://inbox.sourceware.org/libc-alpha/20240305150131.GD3653@qaa.vinc17.org/T/#m3ceecda630012995339bcc5448fee451cf277a8b>
Reported-by: Vincent Lefevre <vincent@vinc17.net>
Suggested-by: Vincent Lefevre <vincent@vinc17.net>
Cc: Morten Welinder <mwelinder@gmail.com>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoscripts/LinuxManBook/prepare.pl: Support some autogenerated pages from other projects
Deri [Tue, 12 Mar 2024 13:46:24 +0000 (14:46 +0100)] 
scripts/LinuxManBook/prepare.pl: Support some autogenerated pages from other projects

And remove a warning about an experimental perl feature, by using a
while instead of a for loop.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoTIMESPEC_TO_TIMEVAL.3, TIMEVAL_TO_TIMESPEC.3: Document these macros
Alejandro Colomar [Thu, 7 Mar 2024 02:21:28 +0000 (03:21 +0100)] 
TIMESPEC_TO_TIMEVAL.3, TIMEVAL_TO_TIMESPEC.3: Document these macros

Reported-by: Guillem Jover <guillem@hadrons.org>
Reviewed-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/configure/build-depends/cc.mk: Use -Wno-unsafe-buffer-usage with clang(1)
Alejandro Colomar [Thu, 7 Mar 2024 01:58:50 +0000 (02:58 +0100)] 
share/mk/configure/build-depends/cc.mk: Use -Wno-unsafe-buffer-usage with clang(1)

That warning has false positives, such as in unix(7).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agounix.7: Use a 'ssize_t' for the return value of read(2) and write(2)
Alejandro Colomar [Wed, 6 Mar 2024 11:25:26 +0000 (12:25 +0100)] 
unix.7: Use a 'ssize_t' for the return value of read(2) and write(2)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agounix.7: Use 'int' to iterate over 'argv'
Alejandro Colomar [Wed, 6 Mar 2024 11:23:32 +0000 (12:23 +0100)] 
unix.7: Use 'int' to iterate over 'argv'

'argc' is an 'int', so we should compare it with a variable of the same
type.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agounix.7: Use int main(void)
Alejandro Colomar [Wed, 6 Mar 2024 11:22:10 +0000 (12:22 +0100)] 
unix.7: Use int main(void)

The arguments were unused.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agounix.7: Remove spurious #include
Alejandro Colomar [Wed, 6 Mar 2024 11:21:37 +0000 (12:21 +0100)] 
unix.7: Remove spurious #include

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agounix.7: Build example programs
Alejandro Colomar [Wed, 6 Mar 2024 11:20:46 +0000 (12:20 +0100)] 
unix.7: Build example programs

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoread.2: tfix
Hugo Gabriel Eyherabide [Tue, 5 Mar 2024 05:14:06 +0000 (07:14 +0200)] 
read.2: tfix

Signed-off-by: Hugo Gabriel Eyherabide <hugogabiel.eyherabide@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agolog2.3, log10.3: wfix
Alejandro Colomar [Tue, 5 Mar 2024 01:15:14 +0000 (02:15 +0100)] 
log2.3, log10.3: wfix

Reported-by: Morten Welinder <mwelinder@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agocbrt.3: wfix: Cube roots are rarely representable
Alejandro Colomar [Tue, 5 Mar 2024 01:01:34 +0000 (02:01 +0100)] 
cbrt.3: wfix: Cube roots are rarely representable

On Thu, Feb 29, 2024 at 07:28:10PM -0500, Morten Welinder wrote:
> The phrase "every representable real value has a representable real
> cube root" is wrong.  In fact, a representable cube root is quite
> rare.

Link: <https://lore.kernel.org/linux-man/ZeYKUOKYS7G90SaV@debian/T/#mff0ab388000c6afdb5e5162804d4a0073de481de>
Reported-by: Morten Welinder <mwelinder@gmail.com>
Cowritten-by: Morten Welinder <mwelinder@gmail.com>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agosignificand.3: significand() uses FLT_RADIX, not 2
Alejandro Colomar [Tue, 5 Mar 2024 00:44:44 +0000 (01:44 +0100)] 
significand.3: significand() uses FLT_RADIX, not 2

It's implemented using scalb(), which uses FLT_RADIX.

Reported-by: Morten Welinder <mwelinder@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agologb.3: logb(x) is floor(log2(fabs(x)))
Alejandro Colomar [Mon, 4 Mar 2024 23:20:09 +0000 (00:20 +0100)] 
logb.3: logb(x) is floor(log2(fabs(x)))

log2(3) doesn't accept negative input, but it seems logb(3) does accept
it.

Link: <https://lore.kernel.org/linux-man/ZeYKUOKYS7G90SaV@debian/T/#u>
Reported-by: Morten Welinder <mwelinder@gmail.com>
Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: dist: Don't package .git/
Alejandro Colomar [Sun, 10 Mar 2024 13:55:54 +0000 (14:55 +0100)] 
share/mk/: dist: Don't package .git/

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoclock_getres.2: HISTORY: Clarify that POSIX.1-2008 only makes mandatory the functions
Alejandro Colomar [Mon, 4 Mar 2024 12:02:29 +0000 (13:02 +0100)] 
clock_getres.2: HISTORY: Clarify that POSIX.1-2008 only makes mandatory the functions

The different clocks are still optional.

Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=218452>
Fixes: 4131356cdab8 ("man*/, man-pages.7: VERSIONS, STANDARDS, HISTORY: Reorganize sections")
Reported-by: Enrique Garcia <cquike@arcor.de>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agocgroups.7: tfix
Alejandro Colomar [Mon, 4 Mar 2024 11:45:24 +0000 (12:45 +0100)] 
cgroups.7: tfix

Closes: <https://bugzilla.kernel.org/show_bug.cgi?id=218105>
Reported-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Add missing include
Alejandro Colomar [Mon, 4 Mar 2024 11:43:42 +0000 (12:43 +0100)] 
share/mk/: Add missing include

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoclock_nanosleep.2: Use 't' rather than 'request'
Alejandro Colomar [Tue, 5 Mar 2024 01:22:46 +0000 (02:22 +0100)] 
clock_nanosleep.2: Use 't' rather than 'request'

It seems much more clear.

Cc: Elliott Hughes <enh@google.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Cc: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agonanosleep.2: Use 'duration' rather than 'request'
Alejandro Colomar [Sun, 3 Mar 2024 12:01:57 +0000 (13:01 +0100)] 
nanosleep.2: Use 'duration' rather than 'request'

It seems much more clear.

Suggested-by: Elliott Hughes <enh@google.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Cc: Bruno Haible <bruno@clisp.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoman*/: epoll_*(), fcntl(), flock(), ioctl(), msgctl(), *prctl(), ptrace(), quotactl...
Alejandro Colomar [Tue, 31 Oct 2023 21:36:33 +0000 (22:36 +0100)] 
man*/: epoll_*(), fcntl(), flock(), ioctl(), msgctl(), *prctl(), ptrace(), quotactl(), reboot(), semctl(), shmctl(), lockf(): Consistently use 'op' and 'operation'

Reported-by: Bruno Haible <bruno@clisp.org>
Cc: Elliott Hughes <enh@google.com>
Cc: Stefan Puiu <stefan.puiu@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoChanges.old: tfix
Jakub Wilk [Wed, 28 Feb 2024 19:08:28 +0000 (20:08 +0100)] 
Changes.old: tfix

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Rewrite most of it
Alejandro Colomar [Wed, 28 Feb 2024 12:44:42 +0000 (13:44 +0100)] 
share/mk/: distcheck: Rewrite most of it

This implementation is simpler.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: build-ex-src: Support long $DISTNAME
Alejandro Colomar [Wed, 28 Feb 2024 12:49:55 +0000 (13:49 +0100)] 
share/mk/: build-ex-src: Support long $DISTNAME

When $DISTNAME is too long, mandoc(1) breaks the last line.  The last
two lines can always be removed safely, which makes it work also in this
case.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Fix path
Alejandro Colomar [Wed, 28 Feb 2024 10:42:17 +0000 (11:42 +0100)] 
share/mk/: Fix path

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoprocess_madvise.2: Fix comments about commit ids
Alejandro Colomar [Tue, 27 Feb 2024 23:10:23 +0000 (00:10 +0100)] 
process_madvise.2: Fix comments about commit ids

Move the comment about the Linux commit id, specify that it's a Linux
commit, and add the glibc commit id too.

Link: <https://sourceware.org/bugzilla/show_bug.cgi?id=27380>
Link: <https://lore.kernel.org/linux-man/Zd5fMGvIlmhQyONs@thunder.hadrons.org/T/#m9129640e1293a94ff1606a2f973522f40c968306>
Fixes: 28628d826661 ("process_madvise.2: Document the glibc wrapper")
Reported-by: Guillem Jover <guillem@hadrons.org>
Cc: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoCONTRIBUTING.d/lint: Rewrite now that we have $SKIP_XFAIL
Alejandro Colomar [Mon, 26 Feb 2024 17:00:43 +0000 (18:00 +0100)] 
CONTRIBUTING.d/lint: Rewrite now that we have $SKIP_XFAIL

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/, man*/: build-ex: Skip expected failures
Alejandro Colomar [Mon, 26 Feb 2024 13:14:02 +0000 (14:14 +0100)] 
share/mk/, man*/: build-ex: Skip expected failures

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoetc/cppcheck/cppcheck.suppress: Silence report
Alejandro Colomar [Mon, 26 Feb 2024 12:28:54 +0000 (13:28 +0100)] 
etc/cppcheck/cppcheck.suppress: Silence report

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/, etc/: Fix dependencies
Alejandro Colomar [Mon, 26 Feb 2024 12:28:29 +0000 (13:28 +0100)] 
share/mk/, etc/: Fix dependencies

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: lint-c: Skip expected failures
Alejandro Colomar [Mon, 26 Feb 2024 11:50:34 +0000 (12:50 +0100)] 
share/mk/: lint-c: Skip expected failures

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoman3/: Say cancelation instead of cancellation
Alejandro Colomar [Mon, 26 Feb 2024 11:48:32 +0000 (12:48 +0100)] 
man3/: Say cancelation instead of cancellation

It's the most common spelling in this project.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: $SKIP_XFAIL: Add variable to allow skipping expected failures
Alejandro Colomar [Mon, 26 Feb 2024 10:30:45 +0000 (11:30 +0100)] 
share/mk/: $SKIP_XFAIL: Add variable to allow skipping expected failures

Default to 'yes'.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: string_copying.7 fails 'check-catman'
Alejandro Colomar [Mon, 26 Feb 2024 02:32:07 +0000 (03:32 +0100)] 
share/mk/: distcheck: string_copying.7 fails 'check-catman'

Except with groff(1) from git HEAD, which will be 1.24.0 eventually.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agombsrtowcs.3: ffix
Alejandro Colomar [Sun, 25 Feb 2024 22:20:18 +0000 (23:20 +0100)] 
mbsrtowcs.3: ffix

With groff-1.23.0, which has a base paragraph indentation of 7, this
line was longer than 80 columns.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/configure/version.mk: $DISTDATECMD: Use committer date, not author date
Alejandro Colomar [Mon, 26 Feb 2024 00:10:41 +0000 (01:10 +0100)] 
share/mk/configure/version.mk: $DISTDATECMD: Use committer date, not author date

Comitter date is always increasing, while author date may jump
backwards, which is problematic with make(1).

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Simplify code
Alejandro Colomar [Sun, 25 Feb 2024 23:26:55 +0000 (00:26 +0100)] 
share/mk/: Simplify code

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Ignore fanotify_init.2 build errors
Alejandro Colomar [Sun, 25 Feb 2024 17:05:20 +0000 (18:05 +0100)] 
share/mk/: distcheck: Ignore fanotify_init.2 build errors

In groff from git HEAD, it doesn't fail, but in 1.23.0, which still
has the default base paragraph indentation set to 7, it reports

troff:man2/fanotify_init.2:322: warning [p 4, 0.7i]: cannot adjust line

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoman*/: srcfix
Alejandro Colomar [Sun, 25 Feb 2024 15:45:30 +0000 (16:45 +0100)] 
man*/: srcfix

Found with:

$ grep -rn '"""' man* \
| grep -v '"""""""""""' \
| sed 's/:.*//' \
| sort \
| uniq;
man2/add_key.2
man2/getrlimit.2
man2/keyctl.2
man2/pivot_root.2
man2/request_key.2
man3/isalpha.3
man3/setlocale.3
man3/toupper.3
man7/capabilities.7
man7/cgroups.7
man7/keyrings.7
man7/locale.7
man7/user_namespaces.7

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoman*/: ffix
Alejandro Colomar [Sun, 25 Feb 2024 14:56:46 +0000 (15:56 +0100)] 
man*/: ffix

Found with:

$ grep -rn '^\.[BI] .* [.,:;)]*$' man*
man2/prctl.2:382:.B FR=1 .
man2/openat2.2:377:.B EAGAIN .
man2/openat2.2:424:.I how.resolve .
man5/elf.5:788:.B PF_R .
man5/networks.5:18:.I name number aliases ...
man5/protocols.5:31:.I protocol number aliases ...
man7/cgroups.7:980:.I """max""" .

Cc: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck-*: Add targets to run 'distcheck' partially
Alejandro Colomar [Sun, 25 Feb 2024 13:31:50 +0000 (14:31 +0100)] 
share/mk/: distcheck-*: Add targets to run 'distcheck' partially

This is mainly for debugging purposes.  I won't document it in
'make help' for now, as it will clutter the output, and isn't so useful
for normal users.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agovsock.7: ffix
наб [Tue, 20 Feb 2024 18:11:25 +0000 (19:11 +0100)] 
vsock.7: ffix

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoprocess_madvise.2: Rename parameter, and use array syntax
Alejandro Colomar [Sun, 25 Feb 2024 12:21:20 +0000 (13:21 +0100)] 
process_madvise.2: Rename parameter, and use array syntax

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoprocess_madvise.2: Document the glibc wrapper
Alejandro Colomar [Sun, 25 Feb 2024 12:15:13 +0000 (13:15 +0100)] 
process_madvise.2: Document the glibc wrapper

$ grepc -n process_madvise /usr/include/
/usr/include/x86_64-linux-gnu/bits/mman_ext.h:25:
extern __ssize_t process_madvise (int __pid_fd, const struct iovec *__iov,
  size_t __count, int __advice,
  unsigned __flags)
  __THROW;

Reported-by: Florian Weimer <fweimer@redhat.com>
Cc: Carlos O'Donell <carlos@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agosigaction.2: HISTORY: Some constants are or were XSI extensions
Alejandro Colomar [Sun, 25 Feb 2024 11:45:32 +0000 (12:45 +0100)] 
sigaction.2: HISTORY: Some constants are or were XSI extensions

Link: <https://lore.kernel.org/linux-man/20240214095707.1824c25c@plasteblaster/T/>
Reported-by: Thomas Orgis <thomas@orgis.org>
Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agosigaction.2: HISTORY: SA_NOCLDSTOP wasn't added in POSIX.1-2001
Alejandro Colomar [Sun, 25 Feb 2024 11:25:03 +0000 (12:25 +0100)] 
sigaction.2: HISTORY: SA_NOCLDSTOP wasn't added in POSIX.1-2001

It already existed in POSIX.1-1996, according to just a few lines above.

Link: <https://lore.kernel.org/linux-man/20240214095707.1824c25c@plasteblaster/T/>
Cc: Thomas Orgis <thomas@orgis.org>
Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agogetdents.2: Add note to misleading field "d_off" in struct linux_dirent64
Vinícius Schütz Piva [Tue, 13 Feb 2024 16:23:55 +0000 (13:23 -0300)] 
getdents.2: Add note to misleading field "d_off" in struct linux_dirent64

The getdents.2 man page details a pair syscalls: getdents() and
getdents64(), both of which are used to get the entries of a directory.
The results are populated into a structure, with the difference between
both syscalls being mostly bitwidth related.

However, the behaviour or the 'd_off' field in both struct linux_dirent
and linux_dirent64 is wrongly documented in this man page.

According to the current manual page, 'd_off' is used to store the
"Offset to the next linux_dirent [...] the distance from the start of
the directory to the start of the next linux_dirent."

This value, though, is filesystem dependent, and much of the time it
stores no such offset.

According to readdir.3 [1] manpage:

 > The value returned in d_off is the same as would be returned by
 > calling telldir(3) at the current position in the directory stream.
 > Be aware that despite its type and name, the d_off field is seldom
 > any kind of directory offset on modern filesystems.  Applications
 > should treat this field as an opaque value, making no assumptions
 > about its contents; see also telldir(3).

Of course, readdir(3) is a glibc function with no ties to
getdents(2), but it was implemented with such syscall and considering
that readdir(3) doesn't process the data from getdents(2) my belief is
that it inherited said behaviour from it [2].  telldir(3) tells a
similar story.

On the example provided at the end of getdents.2, notable is the d_off
value of the very last entry:

--------------- nread=120 ---------------
inode#    file type  d_reclen  d_off   d_name
       2  directory    16         12  .
       2  directory    16         24  ..
      11  directory    24         44  lost+found
      12  regular      16         56  a
  228929  directory    16         68  sub
   16353  directory    16         80  sub2
  130817  directory    16       4096  sub3

which makes a very sudden jump that is obviously not where the entry is
located.

Rerunning this same example but on a ext4 partition gives you garbage
values:

--------------- nread=176 ---------------
inode#    file type  d_reclen  d_off   d_name
    2050  directory    24 4842312636391754590  sub2
       2  directory    24 4844777444668968292  ..
    2051  directory    24 7251781863886579875  sub3
      12  regular      24 7470722685224223838  a
    2049  directory    24 7653193867028490235  sub
      11  directory    32 7925945214358802294  lost+found
       2  directory    24 9223372036854775807  .

In fact, I've had a hard time reproducing nice d_off values on ext2 too,
so what the filesystem does with d_off must have change since then.

On tmpfs it's a count:

--------------- nread=144 ---------------
inode#    file type  d_reclen  d_off   d_name
       1  directory    24          1  .
       1  directory    24          2  ..
       5  directory    24          3  sub3
       4  directory    24          4  sub2
       3  directory    24          5  sub
       2  regular      24          6  a

I've also not been the first to notice this, as you can see from this
stackoverflow issue opened last year:

https://stackoverflow.com/q/75119224

Safe to say, it's a very unreliable field.

Below is a patch that adds a warning besides the d_off field in both
structures, plus a brief explanation on why this field can be mislea-
ding (while also directing the user towards the readdir.3 man page).

Link: [1] <https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/man3/readdir.3>
Link: [2] <https://elixir.bootlin.com/glibc/glibc-2.39/source/sysdeps/unix/sysv/linux/readdir.c>
Signed-off-by: Vinícius Schütz Piva <vinicius.vsczpv@outlook.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: srcfix
Alejandro Colomar [Sun, 25 Feb 2024 10:10:51 +0000 (11:10 +0100)] 
share/mk/: srcfix

Use a variable for the options passed to recursive make(1), to avoid
repetition.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: dist: Show CP instead of INSTALL
Alejandro Colomar [Sat, 24 Feb 2024 00:19:43 +0000 (01:19 +0100)] 
share/mk/: dist: Show CP instead of INSTALL

We're using install(1), but it's just an implementation detail.
Since we're not installing into the system, CP is less confusing.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: dist: FORCE regeneration of version file if necessary
Alejandro Colomar [Sat, 24 Feb 2024 00:15:13 +0000 (01:15 +0100)] 
share/mk/: dist: FORCE regeneration of version file if necessary

If any of $DISTVERSION, $DISTNAME, or $DISTDATE have changed since the
last 'make dist', force regeneration of the version file, even if it
wouldn't change due to normal dependencies.  This makes sure that the
tarball has correct values.

It doesn't need to depend on all $DISTFILES.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: $DISTDATE: If the repository is "dirty", use the newest timestamp
Alejandro Colomar [Sat, 24 Feb 2024 00:10:35 +0000 (01:10 +0100)] 
share/mk/: $DISTDATE: If the repository is "dirty", use the newest timestamp

Otherwise, the files within the 'dist' tarball will have a timestamp
older than their last actual modification, which is problematic with
'distcheck'.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: dist: Preserve links with cp(1)
Alejandro Colomar [Fri, 23 Feb 2024 21:07:31 +0000 (22:07 +0100)] 
share/mk/: dist: Preserve links with cp(1)

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Consistently use 'cp -T'
Alejandro Colomar [Fri, 23 Feb 2024 21:04:31 +0000 (22:04 +0100)] 
share/mk/: Consistently use 'cp -T'

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/configure/version.mk: $DISTNAME: Pass --dirty to git-describe(1)
Alejandro Colomar [Fri, 23 Feb 2024 14:38:59 +0000 (15:38 +0100)] 
share/mk/configure/version.mk: $DISTNAME: Pass --dirty to git-describe(1)

This makes sure we don't accidentally produce release tarballs from a
dirty repository.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/configure/version.mk: $DISTNAME: Don't hide git(1) errors
Alejandro Colomar [Fri, 23 Feb 2024 14:30:23 +0000 (15:30 +0100)] 
share/mk/configure/version.mk: $DISTNAME: Don't hide git(1) errors

We don't call git(1) inside tarballs anymore to get the $DISTNAME, so we
can safely assume that git(1) should never fail, and if it fails, we
better get an error message.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Remove old directory before untarring the new tarball
Alejandro Colomar [Thu, 22 Feb 2024 17:10:30 +0000 (18:10 +0100)] 
share/mk/: distcheck: Remove old directory before untarring the new tarball

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Fix dependencies
Alejandro Colomar [Thu, 22 Feb 2024 17:01:39 +0000 (18:01 +0100)] 
share/mk/: distcheck: Fix dependencies

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Fix path
Alejandro Colomar [Thu, 22 Feb 2024 15:16:21 +0000 (16:16 +0100)] 
share/mk/: Fix path

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Support an absolute path in $builddir
Alejandro Colomar [Thu, 22 Feb 2024 14:12:53 +0000 (15:12 +0100)] 
share/mk/: distcheck: Support an absolute path in $builddir

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Use temporary dirs within $builddir
Alejandro Colomar [Thu, 22 Feb 2024 11:19:28 +0000 (12:19 +0100)] 
share/mk/: distcheck: Use temporary dirs within $builddir

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoclose_range.2: srcfix
Alejandro Colomar [Thu, 22 Feb 2024 11:04:29 +0000 (12:04 +0100)] 
close_range.2: srcfix

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Use a variable to prefix recursive make(1) output
Alejandro Colomar [Thu, 22 Feb 2024 10:52:39 +0000 (11:52 +0100)] 
share/mk/: Use a variable to prefix recursive make(1) output

Piping the output to sed(1) didn't behave well with -Orecurse.  Using a
variable behaves well, keeping output synchronized.  The length of the
variable name is specific, so that `$(INFO_)` uses exactly 8 characters,
a tab.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoGNUmakefile: help: Document 'distcheck'
Alejandro Colomar [Sun, 18 Feb 2024 15:51:59 +0000 (16:51 +0100)] 
GNUmakefile: help: Document 'distcheck'

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoclose_range.2: Add _GNU_SOURCE and <unistd.h> to SYNOPSIS
Mark Wielaard [Mon, 12 Feb 2024 12:07:04 +0000 (13:07 +0100)] 
close_range.2: Add _GNU_SOURCE and <unistd.h> to SYNOPSIS

close_range() is defined in <unistd.h> when _GNU_SOURCE is defined.
The <linux/close_range.h> header file only defines the (linux-specific)
flags constants.  The flags argument is an int, not an unsigned int, in
the glibc wrapper.  Use the close_range() library call in the example
code instead of syscall().

Fixes: 71a62d6c3c56 ("close_range.2: Glibc added a wrapper recently")
Fixes: c2356ba085ed ("close_range.2: Glibc 2.34 has added a close_range() wrapper")
Reported-by: Alexandra Hájková <ahajkova@redhat.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
[alx: ffix]
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agogetaddrinfo.3: tfix
Štěpán Němec [Mon, 12 Feb 2024 09:09:03 +0000 (10:09 +0100)] 
getaddrinfo.3: tfix

(Incidentally, the glibc function source does name the parameter
"name" rather than "node", unlike this man page.  (The POSIX man
page uses "nodename".))

Signed-off-by: Štěpán Němec <stepnem@smrk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoman*/: tfix
Štěpán Němec [Mon, 12 Feb 2024 09:09:02 +0000 (10:09 +0100)] 
man*/: tfix

Signed-off-by: Štěpán Němec <stepnem@smrk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agopath_resolution.7: Work around groff(1) bug
Alejandro Colomar [Sun, 18 Feb 2024 00:35:11 +0000 (01:35 +0100)] 
path_resolution.7: Work around groff(1) bug

Link: <https://savannah.gnu.org/bugs/?65320>
Link: <https://savannah.gnu.org/bugs/?65322>
Link: <https://lists.gnu.org/archive/html/groff/2024-02/msg00039.html>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: clean: Also remove 'distcheck' tmp dirs
Alejandro Colomar [Sat, 17 Feb 2024 03:32:47 +0000 (04:32 +0100)] 
share/mk/: clean: Also remove 'distcheck' tmp dirs

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: $(info ...): Make output more consistent
Alejandro Colomar [Sat, 17 Feb 2024 02:41:34 +0000 (03:41 +0100)] 
share/mk/: $(info ...): Make output more consistent

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Use $(TRUE) instead of ':'
Alejandro Colomar [Thu, 15 Feb 2024 23:26:03 +0000 (00:26 +0100)] 
share/mk/: Use $(TRUE) instead of ':'

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/dist/: dist: Support recursive 'dist'
Alejandro Colomar [Wed, 14 Feb 2024 23:00:55 +0000 (00:00 +0100)] 
share/mk/dist/: dist: Support recursive 'dist'

Hardcode the version and date, and don't use git(1) for selecting the
distribution files.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: distcheck: Add target
Alejandro Colomar [Wed, 14 Feb 2024 22:14:19 +0000 (23:14 +0100)] 
share/mk/: distcheck: Add target

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Reorganize build system
Alejandro Colomar [Wed, 14 Feb 2024 13:22:29 +0000 (14:22 +0100)] 
share/mk/: Reorganize build system

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Move configuration variables to share/mk/configure/
Alejandro Colomar [Wed, 14 Feb 2024 01:17:53 +0000 (02:17 +0100)] 
share/mk/: Move configuration variables to share/mk/configure/

Some variables are only part of the implementation of our build system,
and users should not modify them; others are designed to be set by users
when they invoke make(1).  Define the latter in share/mk/configure/, so
that they are more visible.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
17 months agoshare/mk/: Move '.SILENT:' to GNUmakefile
Alejandro Colomar [Wed, 14 Feb 2024 01:23:34 +0000 (02:23 +0100)] 
share/mk/: Move '.SILENT:' to GNUmakefile

Signed-off-by: Alejandro Colomar <alx@kernel.org>