All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fflush.3: SEE ALSO: Add fpurge(3)
@ 2021-05-09 21:38 Alejandro Colomar
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
                   ` (35 more replies)
  0 siblings, 36 replies; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

fpurge(i_stream) does the same as fflush(i_stream), AFAIK.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---

Hi Michael,

This is the first of many separate patches that I had pending for you.
Some of them I already sent you, and you should ignore the old versions.
Some of them are new.
Please review them thoroughly, as I may have sent some patch that wasn't
ready.  In theory I have reviewed them enough, but there are a lot, and
I might have overlooked something.


When you review this "set", I'll send you another one about the SYNOPSIS.


Thanks,

Alex


 man3/fflush.3 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/man3/fflush.3 b/man3/fflush.3
index 138c9bcfe..a600da2ae 100644
--- a/man3/fflush.3
+++ b/man3/fflush.3
@@ -133,6 +133,7 @@ or
 .BR sync (2),
 .BR write (2),
 .BR fclose (3),
+.BR fpurge (3),
 .BR fileno (3),
 .BR fopen (3),
 .BR setbuf (3),
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged()
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
@ 2021-05-09 21:38 ` Alejandro Colomar
  2021-05-09 23:27   ` Michael Kerrisk (man-pages)
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
                   ` (34 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases      | 17 ++++++++++++++++-
 scripts/modified_pages.sh | 34 ----------------------------------
 2 files changed, 16 insertions(+), 35 deletions(-)
 delete mode 100755 scripts/modified_pages.sh

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index a14c65cd4..8cedc4efc 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0-only
 ########################################################################
 #
-# (C) Copyright 2021, Alejandro Colomar
+# (C) Copyright 2020, 2021, Alejandro Colomar
 # These functions are free software; you can redistribute them and/or
 # modify them under the terms of the GNU General Public License
 # as published by the Free Software Foundation; version 2.
@@ -147,6 +147,21 @@ function pdfman()
 	xdg-open ${tmp};
 }
 
+#  man_gitstaged  prints a list of all files with changes staged for commit
+# (basename only if the files are within <man?/>), separated by ", ".
+# Usage example:  .../man-pages$ git commit -m "$(man_gitstaged): msg";
+
+function man_gitstaged()
+{
+	git status							\
+	|sed "/Changes not staged for commit:/q"			\
+	|grep -E "^\s*(modified|deleted|new file):"			\
+	|sed "s/^.*:\s*/, /"						\
+	|sed "s%man[1-9]/%%"						\
+	|tr -d '\n'							\
+	|sed "s/^, //"
+}
+
 ########################################################################
 #	Glibc
 
diff --git a/scripts/modified_pages.sh b/scripts/modified_pages.sh
deleted file mode 100755
index f6c4a6cea..000000000
--- a/scripts/modified_pages.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-
-## SPDX-License-Identifier: GPL-2.0-only
-########################################################################
-##
-## (C) Copyright 2020, Alejandro Colomar
-## This program is free software; you can redistribute it and/or
-## modify it under the terms of the GNU General Public License
-## as published by the Free Software Foundation; version 2.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-## GNU General Public License for more details
-## (http://www.gnu.org/licenses/gpl-2.0.html).
-##
-########################################################################
-##
-## The output of this script is a
-## list of all files with changes staged for commit
-## (basename only if the files are within "man?/"),
-## separated by ", ".
-## Usage:
-## git commit -m "$(./scripts/modified_pages.sh): Short message here"
-##
-
-
-git status							\
-|sed "/Changes not staged for commit:/q"			\
-|grep -E "^\s*(modified|deleted|new file):"			\
-|sed "s/^.*:\s*/, /"						\
-|sed "s%man[1-9]/%%"						\
-|tr -d '\n'							\
-|sed "s/^, //"
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
@ 2021-05-09 21:38 ` Alejandro Colomar
  2021-05-09 23:31   ` Michael Kerrisk (man-pages)
  2021-05-09 21:38 ` [PATCH] basename.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
                   ` (33 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, Jakub Wilk

The output of 'git status' is not stable.

The more stable 'git status --porcelain' is more complex,
and scripting around it would be more complex.

However, 'git diff --staged --name-only' produces
the output that we were lookiong for.

Reported-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 8cedc4efc..d9b6047d1 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -153,13 +153,11 @@ function pdfman()
 
 function man_gitstaged()
 {
-	git status							\
-	|sed "/Changes not staged for commit:/q"			\
-	|grep -E "^\s*(modified|deleted|new file):"			\
-	|sed "s/^.*:\s*/, /"						\
+	git diff --staged --name-only					\
+	|sed "s/$/, /"							\
 	|sed "s%man[1-9]/%%"						\
 	|tr -d '\n'							\
-	|sed "s/^, //"
+	|sed "s/, $//"
 }
 
 ########################################################################
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] basename.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
@ 2021-05-09 21:38 ` Alejandro Colomar
  2021-05-09 23:59   ` Michael Kerrisk (man-pages)
  2021-05-09 21:38 ` [PATCH] dladdr.3: " Alejandro Colomar
                   ` (32 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Glibc uses 'const' for the basename() parameter.
Fix the prototype.

......

.../glibc$ grep_glibc_prototype basename
string/string.h:511:
extern char *basename (const char *__filename) __THROW __nonnull ((1));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/basename.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/basename.3 b/man3/basename.3
index 65a14e8cb..51825eca4 100644
--- a/man3/basename.3
+++ b/man3/basename.3
@@ -32,7 +32,7 @@ basename, dirname \- parse pathname components
 .B #include <libgen.h>
 .PP
 .BI "char *dirname(char *" path );
-.BI "char *basename(char *" path );
+.BI "char *basename(const char *" path );
 .fi
 .SH DESCRIPTION
 Warning: there are two different functions
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] dladdr.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (2 preceding siblings ...)
  2021-05-09 21:38 ` [PATCH] basename.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
@ 2021-05-09 21:38 ` Alejandro Colomar
  2021-05-09 23:20   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] open.2: Fix bug in linkat(2) call example Alejandro Colomar
                   ` (31 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:38 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Glibc uses 'const' for the 1st parameter of these functions.
Fix the prototypes.

......

.../glibc$ grep_glibc_prototype dladdr
dlfcn/dlfcn.h:98:
extern int dladdr (const void *__address, Dl_info *__info)
     __THROW __nonnull ((2));
.../glibc$ grep_glibc_prototype dladdr1
dlfcn/dlfcn.h:102:
extern int dladdr1 (const void *__address, Dl_info *__info,
		    void **__extra_info, int __flags) __THROW __nonnull ((2));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/dladdr.3 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man3/dladdr.3 b/man3/dladdr.3
index 19944174b..c95df4e49 100644
--- a/man3/dladdr.3
+++ b/man3/dladdr.3
@@ -31,9 +31,9 @@ dladdr, dladdr1 \- translate address to symbolic information
 .B #define _GNU_SOURCE
 .B #include <dlfcn.h>
 .PP
-.BI "int dladdr(void *" addr ", Dl_info *" info );
-.BI "int dladdr1(void *" addr ", Dl_info *" info ", void **" \
-        extra_info ", int " flags );
+.BI "int dladdr(const void *" addr ", Dl_info *" info );
+.BI "int dladdr1(const void *" addr ", Dl_info *" info ", void **" extra_info ,
+.BI "            int " flags );
 .PP
 Link with \fI\-ldl\fP.
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] open.2: Fix bug in linkat(2) call example
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (3 preceding siblings ...)
  2021-05-09 21:38 ` [PATCH] dladdr.3: " Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-10  0:50   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] malloc_usable_size.3: ffix Alejandro Colomar
                   ` (30 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Alejandro Colomar, linux-man, Walter Harms, Theodore Ts'o,
	Adam Borowski

AT_EMPTY_PATH works with empty strings (""), but not with NULL
(or at least it's not obvious).

The relevant kernel code is the following:

linux$ sed -n 189,198p fs/namei.c
	result->refcnt = 1;
	/* The empty path is special. */
	if (unlikely(!len)) {
		if (empty)
			*empty = 1;
		if (!(flags & LOOKUP_EMPTY)) {
			putname(result);
			return ERR_PTR(-ENOENT);
		}
	}

Reported-by: Walter Harms <wharms@bfs.de>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/open.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/open.2 b/man2/open.2
index 6360636af..bac1ee806 100644
--- a/man2/open.2
+++ b/man2/open.2
@@ -824,7 +824,7 @@ fd = open("/path/to/dir", O_TMPFILE | O_RDWR,
 
 /* File I/O on \(aqfd\(aq... */
 
-linkat(fd, NULL, AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
+linkat(fd, "", AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
 
 /* If the caller doesn\(aqt have the CAP_DAC_READ_SEARCH
    capability (needed to use AT_EMPTY_PATH with linkat(2)),
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] malloc_usable_size.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (4 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] open.2: Fix bug in linkat(2) call example Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:10   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] getutmp.3: ffix Alejandro Colomar
                   ` (29 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/malloc_usable_size.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/malloc_usable_size.3 b/man3/malloc_usable_size.3
index 4b4ba3dca..5f892ef6c 100644
--- a/man3/malloc_usable_size.3
+++ b/man3/malloc_usable_size.3
@@ -29,7 +29,7 @@ malloc_usable_size \- obtain size of block of memory allocated from heap
 .nf
 .B #include <malloc.h>
 .PP
-.BI "size_t malloc_usable_size (void *" ptr );
+.BI "size_t malloc_usable_size(void *" ptr );
 .fi
 .SH DESCRIPTION
 The
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] getutmp.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (5 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] malloc_usable_size.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:10   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] on_exit.3: ffix Alejandro Colomar
                   ` (28 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/getutmp.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man3/getutmp.3 b/man3/getutmp.3
index e5e85aced..012cfdf6f 100644
--- a/man3/getutmp.3
+++ b/man3/getutmp.3
@@ -31,8 +31,8 @@ getutmp, getutmpx \- copy utmp structure to utmpx, and vice versa
 .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
 .B #include <utmpx.h>
 .PP
-.BI " void getutmp(const struct utmpx *" ux ", struct utmp *" u );
-.BI " void getutmpx(const struct utmp *" u ", struct utmpx *" ux );
+.BI "void getutmp(const struct utmpx *" ux ", struct utmp *" u );
+.BI "void getutmpx(const struct utmp *" u ", struct utmpx *" ux );
 .fi
 .SH DESCRIPTION
 The
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] on_exit.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (6 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] getutmp.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:11   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] perror.3: ffix Alejandro Colomar
                   ` (27 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/on_exit.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/on_exit.3 b/man3/on_exit.3
index afcd9f9ed..7997b601e 100644
--- a/man3/on_exit.3
+++ b/man3/on_exit.3
@@ -35,7 +35,7 @@ on_exit \- register a function to be called at normal process termination
 .nf
 .B #include <stdlib.h>
 .PP
-.BI "int on_exit(void (*" function ")(int , void *), void *" arg );
+.BI "int on_exit(void (*" function ")(int, void *), void *" arg );
 .fi
 .PP
 .RS -4
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] perror.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (7 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] on_exit.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:12   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12 Alejandro Colomar
                   ` (26 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/perror.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/perror.3 b/man3/perror.3
index ae271f343..e3eec1da3 100644
--- a/man3/perror.3
+++ b/man3/perror.3
@@ -39,7 +39,7 @@ perror \- print a system error message
 .PP
 .B #include <errno.h>
 .PP
-.BI "const char * const " sys_errlist [];
+.BI "const char *const " sys_errlist [];
 .BI "int " sys_nerr ;
 .BI "int " errno ";       \fR/* Not really declared this way; see errno(3) */"
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (8 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] perror.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-10  0:01   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] sched_get_priority_max.2, open_memstream.3: tfix Alejandro Colomar
                   ` (25 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Alejandro Colomar, linux-man, Luis Henriques, Amir Goldstein,
	Greg KH, Anna Schumaker, Jeff Layton, Steve French,
	Miklos Szeredi, Trond Myklebust, Alexander Viro, Darrick J. Wong,
	Dave Chinner, Nicolas Boichat, Ian Lance Taylor, Luis Lozano,
	Andreas Dilger, Olga Kornievskaia, Christoph Hellwig, ceph-devel,
	linux-kernel, CIFS, samba-technical, linux-fsdevel,
	Linux NFS Mailing List, Walter Harms

Linux 5.12 fixes a regression.

Cross-filesystem (introduced in 5.3) copies were buggy.

Move the statements documenting cross-fs to BUGS.
Kernels 5.3..5.11 should be patched soon.

State version information for some errors related to this.

Reported-by: Luis Henriques <lhenriques@suse.de>
Reported-by: Amir Goldstein <amir73il@gmail.com>
Related: <https://lwn.net/Articles/846403/>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Anna Schumaker <anna.schumaker@netapp.com>
Cc: Jeff Layton <jlayton@kernel.org>
Cc: Steve French <sfrench@samba.org>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Dave Chinner <dchinner@redhat.com>
Cc: Nicolas Boichat <drinkcat@chromium.org>
Cc: Ian Lance Taylor <iant@google.com>
Cc: Luis Lozano <llozano@chromium.org>
Cc: Andreas Dilger <adilger@dilger.ca>
Cc: Olga Kornievskaia <aglo@umich.edu>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: ceph-devel <ceph-devel@vger.kernel.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Cc: CIFS <linux-cifs@vger.kernel.org>
Cc: samba-technical <samba-technical@lists.samba.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Cc: Walter Harms <wharms@bfs.de>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/copy_file_range.2 | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2
index 467a16300..843e02241 100644
--- a/man2/copy_file_range.2
+++ b/man2/copy_file_range.2
@@ -169,6 +169,9 @@ Out of memory.
 .B ENOSPC
 There is not enough space on the target filesystem to complete the copy.
 .TP
+.BR EOPNOTSUPP " (since Linux 5.12)"
+The filesystem does not support this operation.
+.TP
 .B EOVERFLOW
 The requested source or destination range is too large to represent in the
 specified data types.
@@ -184,10 +187,17 @@ or
 .I fd_out
 refers to an active swap file.
 .TP
-.B EXDEV
+.BR EXDEV " (before Linux 5.3)"
+The files referred to by
+.IR fd_in " and " fd_out
+are not on the same filesystem.
+.TP
+.BR EXDEV " (since Linux 5.12)"
 The files referred to by
 .IR fd_in " and " fd_out
-are not on the same mounted filesystem (pre Linux 5.3).
+are not on the same filesystem,
+and the source and target filesystems are not of the same type,
+or do not support cross-filesystem copy.
 .SH VERSIONS
 The
 .BR copy_file_range ()
@@ -200,8 +210,11 @@ Areas of the API that weren't clearly defined were clarified and the API bounds
 are much more strictly checked than on earlier kernels.
 Applications should target the behaviour and requirements of 5.3 kernels.
 .PP
-First support for cross-filesystem copies was introduced in Linux 5.3.
-Older kernels will return -EXDEV when cross-filesystem copies are attempted.
+Since Linux 5.12,
+cross-filesystem copies can be achieved
+when both filesystems are of the same type,
+and that filesystem implements support for it.
+See BUGS for behavior prior to 5.12.
 .SH CONFORMING TO
 The
 .BR copy_file_range ()
@@ -226,6 +239,12 @@ gives filesystems an opportunity to implement "copy acceleration" techniques,
 such as the use of reflinks (i.e., two or more inodes that share
 pointers to the same copy-on-write disk blocks)
 or server-side-copy (in the case of NFS).
+.SH BUGS
+In Linux kernels 5.3 to 5.11,
+cross-filesystem copies were implemented by the kernel,
+if the operation was not supported by individual filesystems.
+However, on some virtual filesystems,
+the call failed to copy, while still reporting success.
 .SH EXAMPLES
 .EX
 #define _GNU_SOURCE
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] sched_get_priority_max.2, open_memstream.3: tfix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (9 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12 Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:19   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] __ppc_get_timebase.3: ffix Alejandro Colomar
                   ` (24 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/sched_get_priority_max.2 | 2 +-
 man3/open_memstream.3         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man2/sched_get_priority_max.2 b/man2/sched_get_priority_max.2
index 8a857f6e7..2afd88681 100644
--- a/man2/sched_get_priority_max.2
+++ b/man2/sched_get_priority_max.2
@@ -80,7 +80,7 @@ thus it is a good idea for portable applications to use a virtual
 priority range and map it to the interval given by
 .BR sched_get_priority_max ()
 and
-.BR sched_get_priority_min
+.BR sched_get_priority_min ()
 POSIX.1 requires
 .\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
 a spread of at least 32 between the maximum and the minimum values for
diff --git a/man3/open_memstream.3 b/man3/open_memstream.3
index ba6cbfa75..ea1489cb8 100644
--- a/man3/open_memstream.3
+++ b/man3/open_memstream.3
@@ -110,7 +110,7 @@ l l l.
 Interface	Attribute	Value
 T{
 .BR open_memstream (),
-.BR open_wmemstream
+.BR open_wmemstream ()
 T}	Thread safety	MT-Safe
 .TE
 .hy
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] __ppc_get_timebase.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (10 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] sched_get_priority_max.2, open_memstream.3: tfix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:14   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments() Alejandro Colomar
                   ` (23 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/__ppc_get_timebase.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/__ppc_get_timebase.3 b/man3/__ppc_get_timebase.3
index 9939767ae..618ca74dc 100644
--- a/man3/__ppc_get_timebase.3
+++ b/man3/__ppc_get_timebase.3
@@ -31,7 +31,7 @@ __ppc_get_timebase, __ppc_get_timebase_freq \- get the current value
 .nf
 .B #include <sys/platform/ppc.h>
 .PP
-.BI "uint64_t __ppc_get_timebase(void)"
+.BI "uint64_t __ppc_get_timebase(void);"
 .BI "uint64_t __ppc_get_timebase_freq(void);"
 .fi
 .SH DESCRIPTION
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments().
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (11 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] __ppc_get_timebase.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:32   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables Alejandro Colomar
                   ` (22 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

This patch makes man_lsfunc() search for the function prototypes,
instead of relying on the current manual page formatting,
which might change in the future, and break this function.

It also simplifies the code, by reusing man_section().

Create a new function sed_rm_ccomments(), which is needed by
man_lsfunc(), and may also be useful in other cases.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index d9b6047d1..c50108a16 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -20,6 +20,21 @@
 EX_OK=0;
 EX_USAGE=64;
 
+########################################################################
+#	C
+
+#  sed_rm_ccomments()  removes C comments.
+# It can't handle multiple comments in a sinlge line correctly,
+# nor mixed or embedded //... and /*...*/ comments.
+# Use as a filter (see man_lsfunc() in this file).
+
+function sed_rm_ccomments()
+{
+	sed 's%/\*.*\*/%%' \
+	|sed -E '\%/\*%,\%\*/%{\%(\*/|/\*)%!d; s%/\*.*%%; s%.*\*/%%;}' \
+	|sed 's%//.*%%';
+}
+
 ########################################################################
 #	Linux kernel
 
@@ -106,25 +121,13 @@ function man_lsfunc()
 		return ${EX_USAGE};
 	fi
 
-	find "${@}" -type f \
-	|xargs grep -l "\.SH SYNOPSIS" \
-	|sort -V \
-	|while read -r manpage; do
-		<${manpage} \
-		sed -n \
-			-e '/^\.TH/,/^\.SH/{/^\.SH/!p}' \
-			-e "/^\.SH SYNOPSIS/p" \
-			-e "/^\.SH SYNOPSIS/,/^\.SH/{/^\.SH/!p}" \
-		|sed \
-			-e '/Feature/,$d' \
-			-e '/{/,/}/d' \
-		|man -P cat -l - 2>/dev/null;
+	for arg in "$@"; do
+		man_section "${arg}" 'SYNOPSIS';
 	done \
-	|sed -n "/^SYNOPSIS/,/^\w/p" \
-	|grep '^       \w' \
-	|grep -v ':' \
-	|sed 's/^[^(]* \**\(\w*\)(.*/\1/' \
-	|grep '^\w' \
+	|sed_rm_ccomments \
+	|pcregrep -Mn '(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]+?(...)?\s*\); *$' \
+	|grep '^[0-9]' \
+	|sed -E 's/^[^(]+ \**(\w+)\(.*/\1/' \
 	|uniq;
 }
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (12 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments() Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:32   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
                   ` (21 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index c50108a16..813c00960 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -131,6 +131,33 @@ function man_lsfunc()
 	|uniq;
 }
 
+#  man_lsvar()  prints the name of all C variables declared in the SYNOPSIS
+# of all manual pages in a directory (or in a single manual page file).
+# Each name is printed in a separate line
+# Usage example:  .../man-pages$ man_lsvar man3;
+
+function man_lsvar()
+{
+	if ! [ -v 1 ]; then
+		>&2 echo "Usage: ${FUNCNAME[0]} <dir>";
+		return ${EX_USAGE};
+	fi
+
+	for arg in "$@"; do
+		man_section "${arg}" 'SYNOPSIS';
+	done \
+	|sed_rm_ccomments \
+	|pcregrep -Mv '(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]+?(...)?\s*\); *$' \
+	|pcregrep -Mn \
+	  -e '(?s)^ +extern [\w ]+ \**\(\*+[\w ]+\)\([\w\s(,)[\]*]+?\s*\); *$' \
+	  -e '^ +extern [\w ]+ \**[\w ]+; *$' \
+	|grep '^[0-9]' \
+	|grep -v 'typedef' \
+	|sed -E 's/^[0-9]+: +extern [^(]+ \**\(\*+(\w* )?(\w+)\)\(.*/\2/' \
+	|sed    's/^[0-9]\+: \+extern .* \**\(\w\+\); */\1/' \
+	|uniq;
+}
+
 #  pdfman()  renders a manual page in PDF
 # Usage example:  .../man-pages$ pdfman man2/membarrier.2;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (13 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:53   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] pthread_attr_setschedparam.3: " Alejandro Colomar
                   ` (20 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Both POSIX and glibc use 'restrict' in
pthread_attr_getinheritsched().
Let's use it here too.

.../glibc$ grep_glibc_prototype pthread_attr_getinheritsched
sysdeps/htl/pthread.h:90:
extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr,
					 int *__restrict __inheritsched)
	__THROW __nonnull ((1, 2));
sysdeps/nptl/pthread.h:313:
extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
					 __attr, int *__restrict __inherit)
     __THROW __nonnull ((1, 2));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/pthread_attr_setinheritsched.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man3/pthread_attr_setinheritsched.3 b/man3/pthread_attr_setinheritsched.3
index 4ac1e3e7f..b834c1fd7 100644
--- a/man3/pthread_attr_setinheritsched.3
+++ b/man3/pthread_attr_setinheritsched.3
@@ -33,8 +33,8 @@ inherit-scheduler attribute in thread attributes object
 .PP
 .BI "int pthread_attr_setinheritsched(pthread_attr_t *" attr ,
 .BI "                                 int " inheritsched );
-.BI "int pthread_attr_getinheritsched(const pthread_attr_t *" attr ,
-.BI "                                 int *" inheritsched );
+.BI "int pthread_attr_getinheritsched(const pthread_attr_t *restrict " attr ,
+.BI "                                 int *restrict " inheritsched );
 .PP
 Compile and link with \fI\-pthread\fP.
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] pthread_attr_setschedparam.3: SYNOPSIS: Use 'restrict' in prototypes
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (14 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:53   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] strsignal.3: ffix Alejandro Colomar
                   ` (19 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Both POSIX and glibc use 'restrict' in
pthread_attr_getschedparam(), pthread_attr_setschedparam().
Let's use it here too.

.../glibc$ grep_glibc_prototype pthread_attr_getschedparam
sysdeps/htl/pthread.h:102:
extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
				       struct sched_param *__restrict __param)
	__THROW __nonnull ((1, 2));
sysdeps/nptl/pthread.h:294:
extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
				       struct sched_param *__restrict __param)
     __THROW __nonnull ((1, 2));
.../glibc$ grep_glibc_prototype pthread_attr_setschedparam
sysdeps/htl/pthread.h:107:
extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
				       const struct sched_param *__restrict
				       __param) __THROW __nonnull ((1, 2));
sysdeps/nptl/pthread.h:299:
extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
				       const struct sched_param *__restrict
				       __param) __THROW __nonnull ((1, 2));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/pthread_attr_setschedparam.3 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/man3/pthread_attr_setschedparam.3 b/man3/pthread_attr_setschedparam.3
index adc3fbcb2..72ee0143a 100644
--- a/man3/pthread_attr_setschedparam.3
+++ b/man3/pthread_attr_setschedparam.3
@@ -31,10 +31,10 @@ scheduling parameter attributes in thread attributes object
 .nf
 .B #include <pthread.h>
 .PP
-.BI "int pthread_attr_setschedparam(pthread_attr_t *" attr ,
-.BI "                               const struct sched_param *" param );
-.BI "int pthread_attr_getschedparam(const pthread_attr_t *" attr ,
-.BI "                               struct sched_param *" param );
+.BI "int pthread_attr_setschedparam(pthread_attr_t *restrict " attr ,
+.BI "                              const struct sched_param *restrict " param );
+.BI "int pthread_attr_getschedparam(const pthread_attr_t *restrict " attr ,
+.BI "                              struct sched_param *restrict " param );
 .PP
 Compile and link with \fI\-pthread\fP.
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] strsignal.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (15 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] pthread_attr_setschedparam.3: " Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:14   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] strsignal.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
                   ` (18 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/strsignal.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/strsignal.3 b/man3/strsignal.3
index cfea6c8b4..6a5a1e610 100644
--- a/man3/strsignal.3
+++ b/man3/strsignal.3
@@ -39,7 +39,7 @@ strsignal, sigdescr_np, sigdescr_np, sys_siglist \- return string describing sig
 .BI "char *sigdescr_np(int " sig );
 .BI "char *sigabbrev_np(int " sig );
 .PP
-.BI "extern const char * const " sys_siglist [];
+.BI "extern const char *const " sys_siglist [];
 .fi
 .PP
 .RS -4
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] strsignal.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (16 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] strsignal.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:16   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.) Alejandro Colomar
                   ` (17 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

glibc uses 'const' in sigdescr_np(), sigabbrev_np().
Let's use it here too.

.../glibc$ grep_glibc_prototype sigdescr_np
string/string.h:469:
extern const char *sigdescr_np (int __sig) __THROW;
.../glibc$ grep_glibc_prototype sigabbrev_np
string/string.h:466:
extern const char *sigabbrev_np (int __sig) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/strsignal.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man3/strsignal.3 b/man3/strsignal.3
index 6a5a1e610..bc4120303 100644
--- a/man3/strsignal.3
+++ b/man3/strsignal.3
@@ -36,8 +36,8 @@ strsignal, sigdescr_np, sigdescr_np, sys_siglist \- return string describing sig
 .B #include <string.h>
 .PP
 .BI "char *strsignal(int " sig );
-.BI "char *sigdescr_np(int " sig );
-.BI "char *sigabbrev_np(int " sig );
+.BI "const char *sigdescr_np(int " sig );
+.BI "const char *sigabbrev_np(int " sig );
 .PP
 .BI "extern const char *const " sys_siglist [];
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.)
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (17 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] strsignal.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:50   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
                   ` (16 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Fix the types for the following functions:

authunix_create(),
callrpc(),
clnt_create(),
clnt_pcreateerror(),
clnt_perror(),
clnt_spcreateerror(),
clnt_sperror(),
pmap_set(),
svc_register(),
svcerr_progvers().

.../glibc$ grep_glibc_prototype authunix_create
sunrpc/rpc/auth.h:158:
extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid,
			      int __len, __gid_t *__aup_gids);
.../glibc$ grep_glibc_prototype callrpc
sunrpc/rpc/clnt.h:359:
extern int callrpc (const char *__host, const u_long __prognum,
		    const u_long __versnum, const u_long __procnum,
		    const xdrproc_t __inproc, const char *__in,
		    const xdrproc_t __outproc, char *__out) __THROW;
.../glibc$ grep_glibc_prototype clnt_create
sunrpc/rpc/clnt.h:291:
extern CLIENT *clnt_create (const char *__host, const u_long __prog,
			    const u_long __vers, const char *__prot)
     __THROW;
.../glibc$ grep_glibc_prototype clnt_pcreateerror
sunrpc/rpc/clnt.h:368:
extern void clnt_pcreateerror (const char *__msg);	/* stderr */
.../glibc$ grep_glibc_prototype clnt_perror
sunrpc/rpc/clnt.h:379:
extern void clnt_perror (CLIENT *__clnt, const char *__msg);
.../glibc$ grep_glibc_prototype clnt_spcreateerror
sunrpc/rpc/clnt.h:369:
extern char *clnt_spcreateerror(const char *__msg) __THROW;	/* string */
.../glibc$ grep_glibc_prototype clnt_sperror
sunrpc/rpc/clnt.h:381:
extern char *clnt_sperror (CLIENT *__clnt, const char *__msg) __THROW;
.../glibc$ grep_glibc_prototype pmap_set
sunrpc/rpc/pmap_clnt.h:69:
extern bool_t pmap_set (const u_long __program, const u_long __vers,
			int __protocol, u_short __port) __THROW;
.../glibc$ grep_glibc_prototype svc_register
sunrpc/rpc/svc.h:188:
extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog,
			    rpcvers_t __vers, __dispatch_fn_t __dispatch,
			    rpcprot_t __protocol) __THROW;
.../glibc$ grep_glibc_prototype svcerr_progvers
sunrpc/rpc/svc.h:253:
extern void	svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers,
				 rpcvers_t __high_vers) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/rpc.3 | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/man3/rpc.3 b/man3/rpc.3
index 1daaaad7e..3d2fe4243 100644
--- a/man3/rpc.3
+++ b/man3/rpc.3
@@ -70,8 +70,8 @@ information with each remote procedure call.
 This is the default authentication used by RPC.
 .PP
 .nf
-.BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid ,
-.BI "                      int " len ", int *" aup_gids );
+.BI "AUTH *authunix_create(char *" host ", uid_t " uid ", gid_t " gid ,
+.BI "                      int " len ", gid_t *" aup_gids );
 .fi
 .IP
 Create and return an RPC authentication handle that contains
@@ -100,7 +100,7 @@ with the appropriate parameters.
 .nf
 .BI "int callrpc(char *" host ", unsigned long " prognum ,
 .BI "            unsigned long " versnum ", unsigned long " procnum ,
-.BI "            xdrproc_t " inproc ", char *" in ,
+.BI "            xdrproc_t " inproc ", const char *" in ,
 .BI "            xdrproc_t " outproc ", char *" out );
 .fi
 .IP
@@ -216,8 +216,8 @@ If the RPC library opened the associated socket, it will close it also.
 Otherwise, the socket remains open.
 .PP
 .nf
-.BI "CLIENT *clnt_create(char *" host ", unsigned long " prog ,
-.BI "                    unsigned long " vers ", char *" proto );
+.BI "CLIENT *clnt_create(const char *" host ", unsigned long " prog ,
+.BI "                    unsigned long " vers ", const char *" proto );
 .fi
 .IP
 Generic client creation routine.
@@ -305,7 +305,7 @@ handle to the structure at address
 .IR errp .
 .PP
 .nf
-.BI "void clnt_pcreateerror(char *" s );
+.BI "void clnt_pcreateerror(const char *" s );
 .fi
 .IP
 Print a message to standard error indicating why a client RPC
@@ -332,7 +332,7 @@ Used after
 .BR callrpc ().
 .PP
 .nf
-.BI "clnt_perror(CLIENT *" clnt ", char *" s );
+.BI "clnt_perror(CLIENT *" clnt ", const char *" s );
 .fi
 .IP
 Print a message to standard error indicating why an RPC call failed;
@@ -345,7 +345,7 @@ Used after
 .BR clnt_call ().
 .PP
 .nf
-.BI "char *clnt_spcreateerror(char *" s );
+.BI "char *clnt_spcreateerror(const char *" s );
 .fi
 .IP
 Like
@@ -383,7 +383,7 @@ returns pointer to static data, but the
 result will not get overwritten on each call.
 .PP
 .nf
-.BI "char *clnt_sperror(CLIENT *" rpch ", char *" s );
+.BI "char *clnt_sperror(CLIENT *" rpch ", const char *" s );
 .fi
 .IP
 Like
@@ -601,7 +601,7 @@ See also
 .PP
 .nf
 .BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum ,
-.BI "                unsigned int " protocol ", unsigned short " port );
+.BI "                int " protocol ", unsigned short " port );
 .fi
 .IP
 A user interface to the
@@ -781,7 +781,7 @@ This interface is obsoleted by
 .nf
 .BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum ,
 .BI "                    unsigned long " versnum ,
-.BI "                    void (*" dispatch ")(svc_req *, SVCXPRT *),"
+.BI "                    void (*" dispatch ")(struct svc_req *, SVCXPRT *),"
 .BI "                    unsigned long " protocol );
 .fi
 .IP
@@ -894,7 +894,8 @@ Called when the desired program is not registered with the RPC package.
 Service implementors usually do not need this routine.
 .PP
 .nf
-.BI "void svcerr_progvers(SVCXPRT *" xprt );
+.BI "void svcerr_progvers(SVCXPRT *" xprt ", unsigned long " low_vers ,
+.BI "                     unsigned long " high_vers );
 .fi
 .IP
 Called when the desired version of a program is not registered
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (18 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.) Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:19   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const' Alejandro Colomar
                   ` (15 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

glibc uses 'const' in pthread_setattr_default_np().
Let's use it here too.

.../glibc$ grep_glibc_prototype pthread_setattr_default_np
sysdeps/nptl/pthread.h:406:
extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
     __THROW __nonnull ((1));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/pthread_getattr_default_np.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/pthread_getattr_default_np.3 b/man3/pthread_getattr_default_np.3
index 903d5095a..5973af5ec 100644
--- a/man3/pthread_getattr_default_np.3
+++ b/man3/pthread_getattr_default_np.3
@@ -32,7 +32,7 @@ get or set default thread-creation attributes
 .B #include <pthread.h>
 .PP
 .BI "int pthread_getattr_default_np(pthread_attr_t *" attr );
-.BI "int pthread_setattr_default_np(pthread_attr_t *" attr );
+.BI "int pthread_setattr_default_np(const pthread_attr_t *" attr );
 .PP
 Compile and link with \fI\-pthread\fP.
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const'
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (19 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:18   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] tzset.3: ffix Alejandro Colomar
                   ` (14 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Neither POSIX or glibc use 'const' in
pthread_mutexattr_setrobust().
Remove it.

.../glibc$ grep_glibc_prototype pthread_mutexattr_setrobust
sysdeps/htl/pthread.h:355:
extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
					int __robustness)
     __THROW __nonnull ((1));
sysdeps/nptl/pthread.h:888:
extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
					int __robustness)
     __THROW __nonnull ((1));
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/pthread_mutexattr_setrobust.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/pthread_mutexattr_setrobust.3 b/man3/pthread_mutexattr_setrobust.3
index dbf429c48..86aab88ed 100644
--- a/man3/pthread_mutexattr_setrobust.3
+++ b/man3/pthread_mutexattr_setrobust.3
@@ -33,7 +33,7 @@ pthread_mutexattr_getrobust, pthread_mutexattr_setrobust
 .PP
 .BI "int pthread_mutexattr_getrobust(const pthread_mutexattr_t *" attr ,
 .BI "                                int *" robustness ");"
-.BI "int pthread_mutexattr_setrobust(const pthread_mutexattr_t *" attr ,
+.BI "int pthread_mutexattr_setrobust(pthread_mutexattr_t *" attr ,
 .BI "                                int " robustness ");"
 .fi
 .PP
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] tzset.3: ffix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (20 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const' Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:16   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] xdr.3: SYNOPSIS: Fix prototype types Alejandro Colomar
                   ` (13 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/tzset.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/tzset.3 b/man3/tzset.3
index e4660be8b..c80da53f8 100644
--- a/man3/tzset.3
+++ b/man3/tzset.3
@@ -37,7 +37,7 @@ tzset, tzname, timezone, daylight \- initialize time conversion information
 .nf
 .B #include <time.h>
 .PP
-.B void tzset (void);
+.B void tzset(void);
 .PP
 .BI "extern char *" tzname [2];
 .BI "extern long " timezone ;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] xdr.3: SYNOPSIS: Fix prototype types
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (21 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] tzset.3: ffix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:51   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections Alejandro Colomar
                   ` (12 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Use the same types glibc uses, and add a missing 'const'.

.../glibc$ grep_glibc_prototype xdr_union
sunrpc/rpc/xdr.h:315:
extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp,
			 const struct xdr_discrim *__choices,
			 xdrproc_t __dfault) __THROW;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/xdr.3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man3/xdr.3 b/man3/xdr.3
index ea6359787..83f668dc9 100644
--- a/man3/xdr.3
+++ b/man3/xdr.3
@@ -460,8 +460,8 @@ integers and their external representations.
 This routine returns one if it succeeds, zero otherwise.
 .PP
 .nf
-.BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp ,
-.BI "                 struct xdr_discrim *" choices ,
+.BI "bool_t xdr_union(XDR *" xdrs ", enum_t *" dscmp ", char *" unp ,
+.BI "                 const struct xdr_discrim *" choices ,
 .BI "                 xdrproc_t " defaultarm ");     /* may equal NULL */"
 .fi
 .IP
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (22 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] xdr.3: SYNOPSIS: Fix prototype types Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:33   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Fix error messages Alejandro Colomar
                   ` (11 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 813c00960..7b1b7da9c 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -85,26 +85,35 @@ function grep_syscall_def()
 ########################################################################
 #	Linux man-pages
 
-#  man_section()  prints a specific manual page section (DESCRIPTION, SYNOPSIS,
+#  man_section()  prints specific manual page sections (DESCRIPTION, SYNOPSIS,
 # ...) of all manual pages in a directory (or in a single manual page file).
-# Usage example:  .../man-pages$ man_section man2 SYNOPSIS;
+# Usage example:  .../man-pages$ man_section man2 SYNOPSIS 'CONFORMING TO';
 
 function man_section()
 {
 	if ! [ -v 2 ]; then
-		>&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>";
+		>&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>...";
 		return ${EX_USAGE};
 	fi
 
-	find "${1}" -type f \
-	|xargs grep -l "\.SH ${2}" \
+	local page="$1";
+	shift;
+	local sect="$@";
+
+	find "${page}" -type f \
+	|xargs wc -l \
+	|grep -v -e '\b1 ' -e '\btotal\b' \
+	|awk '{ print $2 }' \
 	|sort -V \
 	|while read -r manpage; do
-		<${manpage} \
-		sed -n \
-			-e '/^\.TH/,/^\.SH/{/^\.SH/!p}' \
-			-e "/^\.SH ${2}/p" \
-			-e "/^\.SH ${2}/,/^\.SH/{/^\.SH/!p}" \
+		cat \
+		<(<${manpage} sed -n '/^\.TH/,/^\.SH/{/^\.SH/!p}') \
+		<(for s in ${sect}; do
+			<${manpage} \
+			sed -n \
+				-e "/^\.SH ${s}/p" \
+				-e "/^\.SH ${s}/,/^\.SH/{/^\.SH/!p}"; \
+		  done;) \
 		|man -P cat -l - 2>/dev/null;
 	done;
 }
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases: Fix error messages
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (23 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:33   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS Alejandro Colomar
                   ` (10 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Fix the error messages to clearly show that both dirs and manual
pages are accepted, and that more than one argument is accepted.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index 7b1b7da9c..a14026bda 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -126,7 +126,7 @@ function man_section()
 function man_lsfunc()
 {
 	if ! [ -v 1 ]; then
-		>&2 echo "Usage: ${FUNCNAME[0]} <dir>";
+		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
 		return ${EX_USAGE};
 	fi
 
@@ -148,7 +148,7 @@ function man_lsfunc()
 function man_lsvar()
 {
 	if ! [ -v 1 ]; then
-		>&2 echo "Usage: ${FUNCNAME[0]} <dir>";
+		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
 		return ${EX_USAGE};
 	fi
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (24 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Fix error messages Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:52   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] bswap.3: bswap_*() are implemented using functions Alejandro Colomar
                   ` (9 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

'C library/kernel differences' was added to BUGS incorrectly.
Fix it

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/epoll_wait.2 | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/man2/epoll_wait.2 b/man2/epoll_wait.2
index f9b5749df..69c79d6ec 100644
--- a/man2/epoll_wait.2
+++ b/man2/epoll_wait.2
@@ -285,18 +285,6 @@ instance whose interest list is currently empty
 or removed from the interest in another thread).
 The call will block until some file descriptor is later added to the
 interest list (in another thread) and that file descriptor becomes ready.
-.SH BUGS
-In kernels before 2.6.37, a
-.I timeout
-value larger than approximately
-.I LONG_MAX / HZ
-milliseconds is treated as \-1 (i.e., infinity).
-Thus, for example, on a system where
-.I sizeof(long)
-is 4 and the kernel
-.I HZ
-value is 1000,
-this means that timeouts greater than 35.79 minutes are treated as infinity.
 .SS C library/kernel differences
 The raw
 .BR epoll_pwait ()
@@ -312,6 +300,18 @@ The glibc
 wrapper function specifies this argument as a fixed value
 (equal to
 .IR sizeof(sigset_t) ).
+.SH BUGS
+In kernels before 2.6.37, a
+.I timeout
+value larger than approximately
+.I LONG_MAX / HZ
+milliseconds is treated as \-1 (i.e., infinity).
+Thus, for example, on a system where
+.I sizeof(long)
+is 4 and the kernel
+.I HZ
+value is 1000,
+this means that timeouts greater than 35.79 minutes are treated as infinity.
 .SH SEE ALSO
 .BR epoll_create (2),
 .BR epoll_ctl (2),
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] bswap.3: bswap_*() are implemented using functions
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (25 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:55   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] cpow.3: Use 'complex' after the type consistently Alejandro Colomar
                   ` (8 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

See <bits/byteswap.h> in glibc.
These macros call functions of the form __bswap_N(),
which use uintN_t.

Eventhough it's true that they are macros,
it's transparent to the user.

The user will see their results casted to unsigned types
after the conversion do to the underlying functions,
so it's better to document these as the underlying functions,
specifying the types.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/bswap.3 | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/man3/bswap.3 b/man3/bswap.3
index 937ef0416..369daa411 100644
--- a/man3/bswap.3
+++ b/man3/bswap.3
@@ -29,19 +29,19 @@ bswap_16, bswap_32, bswap_64 \- reverse order of bytes
 .nf
 .B #include <byteswap.h>
 .PP
-.BI bswap_16( x );
-.BI bswap_32( x );
-.BI bswap_64( x );
+.BI "uint16_t bswap_16(uint16_t " x );
+.BI "uint32_t bswap_32(uint32_t " x );
+.BI "uint64_t bswap_64(uint64_t " x );
 .fi
 .SH DESCRIPTION
-These macros return a value in which the order of the bytes
+These functions return a value in which the order of the bytes
 in their 2-, 4-, or 8-byte arguments is reversed.
 .SH RETURN VALUE
-These macros return the value of their argument with the bytes reversed.
+These functions return the value of their argument with the bytes reversed.
 .SH ERRORS
-These macros always succeed.
+These functions always succeed.
 .SH CONFORMING TO
-These macros are GNU extensions.
+These functions are GNU extensions.
 .SH EXAMPLES
 The program below swaps the bytes of the 8-byte integer supplied as
 its command-line argument.
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] cpow.3: Use 'complex' after the type consistently
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (26 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] bswap.3: bswap_*() are implemented using functions Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:49   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] clone.2: tfix Alejandro Colomar
                   ` (7 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man3/cpow.3 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man3/cpow.3 b/man3/cpow.3
index 494b88f74..be93bff74 100644
--- a/man3/cpow.3
+++ b/man3/cpow.3
@@ -11,10 +11,10 @@ cpow, cpowf, cpowl \- complex power function
 .nf
 .B #include <complex.h>
 .PP
-.BI "double complex cpow(double complex " x ", complex double " z ");"
-.BI "float complex cpowf(float complex " x ", complex float " z ");"
+.BI "double complex cpow(double complex " x ", double complex " z );
+.BI "float complex cpowf(float complex " x ", float complex " z );
 .BI "long double complex cpowl(long double complex " x ,
-.BI "                          complex long double " z ");"
+.BI "                          long double complex " z );
 .PP
 Link with \fI\-lm\fP.
 .fi
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] clone.2: tfix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (27 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] cpow.3: Use 'complex' after the type consistently Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:17   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: srcfix Alejandro Colomar
                   ` (6 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/clone.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/clone.2 b/man2/clone.2
index 838fbd669..04b4ec38c 100644
--- a/man2/clone.2
+++ b/man2/clone.2
@@ -969,7 +969,7 @@ mask must also include
 .B CLONE_VM
 if
 .B CLONE_SIGHAND
-is specified
+is specified.
 .TP
 .BR CLONE_STOPPED " (since Linux 2.6.0)"
 .\" Precisely: Linux 2.6.0-test2
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] scripts/bash_aliases: srcfix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (28 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] clone.2: tfix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:34   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] Makefile: Fix bug when running in parallel Alejandro Colomar
                   ` (5 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

I clarified the code about two things:

- Checking how many arguments are being passed.
    Here, some functions didn't reject extra arguments when they
    weren't being used.  Fix that.
    I also changed the code to use $#, which is more explicit.
    And use arithmetic expressions, which better indicate that
    we're dealing with numbers.

- Remove unneeded options from sort.
    Reported-by: Stefan Puiu <stefan.puiu@gmail.com>
    After Stefan asked about why am I using 'sort -V',
    I noticed that I really don't need '-V', and it may confuse
    people trying to understand the script, so even though I
    slightly prefer the output of 'sort -V', in this case, it's
    better to use the simpler 'sort' (yet I need 'sort', to
    maintain consistency in the results (find is quite random)).

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 scripts/bash_aliases | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/scripts/bash_aliases b/scripts/bash_aliases
index a14026bda..358e2f37a 100644
--- a/scripts/bash_aliases
+++ b/scripts/bash_aliases
@@ -45,20 +45,20 @@ function sed_rm_ccomments()
 
 function grep_syscall()
 {
-	if ! [ -v 1 ]; then
+	if (($# != 1)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
 		return ${EX_USAGE};
 	fi
 
 	find * -type f \
 	|grep '\.c$' \
-	|sort -V \
+	|sort \
 	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
 	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
 
 	find * -type f \
 	|grep '\.[ch]$' \
-	|sort -V \
+	|sort \
 	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
 	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
 }
@@ -70,14 +70,14 @@ function grep_syscall()
 
 function grep_syscall_def()
 {
-	if ! [ -v 1 ]; then
+	if (($# != 1)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
 		return ${EX_USAGE};
 	fi
 
 	find * -type f \
 	|grep '\.c$' \
-	|sort -V \
+	|sort \
 	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?^}" \
 	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
 }
@@ -91,7 +91,7 @@ function grep_syscall_def()
 
 function man_section()
 {
-	if ! [ -v 2 ]; then
+	if (($# < 2)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>...";
 		return ${EX_USAGE};
 	fi
@@ -104,7 +104,7 @@ function man_section()
 	|xargs wc -l \
 	|grep -v -e '\b1 ' -e '\btotal\b' \
 	|awk '{ print $2 }' \
-	|sort -V \
+	|sort \
 	|while read -r manpage; do
 		cat \
 		<(<${manpage} sed -n '/^\.TH/,/^\.SH/{/^\.SH/!p}') \
@@ -125,7 +125,7 @@ function man_section()
 
 function man_lsfunc()
 {
-	if ! [ -v 1 ]; then
+	if (($# < 1)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
 		return ${EX_USAGE};
 	fi
@@ -147,7 +147,7 @@ function man_lsfunc()
 
 function man_lsvar()
 {
-	if ! [ -v 1 ]; then
+	if (($# < 1)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
 		return ${EX_USAGE};
 	fi
@@ -172,7 +172,7 @@ function man_lsvar()
 
 function pdfman()
 {
-	if ! [ -v 1 ]; then
+	if (($# != 1)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <man-page.n>";
 		return ${EX_USAGE};
 	fi;
@@ -209,14 +209,14 @@ function man_gitstaged()
 
 function grep_glibc_prototype()
 {
-	if ! [ -v 1 ]; then
+	if (($# != 1)); then
 		>&2 echo "Usage: ${FUNCNAME[0]} <func>";
 		return ${EX_USAGE};
 	fi
 
 	find * -type f \
 	|grep '\.h$' \
-	|sort -V \
+	|sort \
 	|xargs pcregrep -Mn \
 	  "(?s)^[\w[][\w\s(,)[:\]]+\s+\**${1}\s*\([\w\s(,)[\]*]+?(...)?\)[\w\s(,)[:\]]*;" \
 	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] Makefile: Fix bug when running in parallel
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (29 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: srcfix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:39   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] .gitignore: Add file Alejandro Colomar
                   ` (4 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Prerequisites can run in parallel.  This wouldn't make any sense
when uninstalling and installing again.

For that, use consecutive commands, which run one after the other
even with multiple cores.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 430090801..fdfaf9645 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,9 @@ INSTALL_DATA = $(INSTALL) -m 644
 INSTALL_DIR = $(INSTALL) -m 755 -d
 
 .PHONY: all
-all: remove install
+all:
+	$(MAKE) uninstall;
+	$(MAKE) install;
 
 # Use with
 #  make HTOPTS=whatever html
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] .gitignore: Add file
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (30 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] Makefile: Fix bug when running in parallel Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-10  1:02   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] system_data_types.7: tfix Alejandro Colomar
                   ` (3 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages
  Cc: Alejandro Colomar, linux-man, Debian man-pages, Dr . Tobias Quathamer

Ignore everything new by default.

This avoids having to update the .gitignore when we need to ignore
something new.  It also avoids accidents that may add an unwanted
temporary file.

Cc: Debian man-pages <manpages@packages.debian.org>
Cc: Dr. Tobias Quathamer <toddy@debian.org>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 .gitignore | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 .gitignore

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..9eb9fc096
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,13 @@
+# Ignore everything new by default
+/*
+
+# Ignore everything in man?/ that doesn't follow conventions (e.g., tmp files)
+!/man?/
+/man?/**
+!/man?/**.?
+
+# These files change name in each release
+!/man-pages*.Announce
+!/man-pages*.lsm
+
+!/scripts/
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] system_data_types.7: tfix
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (31 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] .gitignore: Add file Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:46   ` Michael Kerrisk (man-pages)
  2021-05-09 21:39 ` [PATCH] Makefile: Simplify error handling Alejandro Colomar
                   ` (2 subsequent siblings)
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Those pages didn't exist.  Fix the section number.
I noticed the typo thanks to the HTML pages on man7.org.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man7/system_data_types.7 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
index e038aab1e..ddabefd16 100644
--- a/man7/system_data_types.7
+++ b/man7/system_data_types.7
@@ -374,7 +374,7 @@ POSIX.1-2001 and later.
 .BR getegid (2),
 .BR getgroups (2),
 .BR getresgid (2),
-.BR getgrnam (2),
+.BR getgrnam (3),
 .BR credentials (7)
 .RE
 .\"------------------------------------- id_t -------------------------/
@@ -675,7 +675,7 @@ C11 and later; POSIX.1-2001 and later.
 .IR "See also" :
 .BR setlocale (3),
 .BR localeconv (3),
-.BR charsets (5),
+.BR charsets (7),
 .BR locale (7)
 .RE
 .\"------------------------------------- ldiv_t -----------------------/
@@ -1534,7 +1534,7 @@ POSIX.1-2001 and later.
 .BR getuid (2),
 .BR geteuid (2),
 .BR getresuid (2),
-.BR getpwnam (2),
+.BR getpwnam (3),
 .BR credentials (7)
 .RE
 .\"------------------------------------- uintmax_t --------------------/
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* [PATCH] Makefile: Simplify error handling
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (32 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] system_data_types.7: tfix Alejandro Colomar
@ 2021-05-09 21:39 ` Alejandro Colomar
  2021-05-09 23:45   ` Michael Kerrisk (man-pages)
  2021-05-10  1:03 ` [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Michael Kerrisk (man-pages)
       [not found] ` <20210509213930.94120-33-alx.manpages@gmail.com>
  35 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar @ 2021-05-09 21:39 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man

Instead of having to write '|| exit $$?' all the time,
use the shell's '-Eeuo pipefail' options, which handle
errors even better.  However, pipefail needs bash,
so POSIX sh (default) is not valid.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---

Hi Michael,

I'm not sure how much POSIX sh compatibility is needed for the man pages
Makefile.  There are probably projects out there that don't have bash,
and still want to use it.  So maybe we should't apply this.  I don't know.
Up to you.

Thanks,

Alex


 Makefile | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index fdfaf9645..4df4f5846 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 #!/usr/bin/make -f
+SHELL = /bin/bash -Eeuo pipefail
 
 # Do not print "Entering directory ..."
 MAKEFLAGS += --no-print-directory
@@ -33,15 +34,14 @@ html: | builddirs-html
 	|while read f; do \
 		man2html $(HTOPTS) "$$f" \
 		|sed -e '1,2d' \
-		>"$(htmlbuilddir)/$${f}$(htmlext)" \
-			|| exit $$?; \
+		>"$(htmlbuilddir)/$${f}$(htmlext)"; \
 	done;
 
 .PHONY: builddirs-html
 builddirs-html:
 	find man?/ -type d \
 	|while read d; do \
-		$(INSTALL_DIR) "$(htmlbuilddir)/$$d" || exit $$?; \
+		$(INSTALL_DIR) "$(htmlbuilddir)/$$d"; \
 	done;
 
 .PHONY: install-html
@@ -49,57 +49,57 @@ install-html: | installdirs-html
 	cd $(htmlbuilddir) && \
 	find man?/ -type f \
 	|while read f; do \
-		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(htmldir_)/$$f" || exit $$?; \
+		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(htmldir_)/$$f"; \
 	done;
 
 .PHONY: installdirs-html
 installdirs-html:
 	find man?/ -type d \
 	|while read d; do \
-		$(INSTALL_DIR) "$(DESTDIR)$(htmldir_)/$$d" || exit $$?; \
+		$(INSTALL_DIR) "$(DESTDIR)$(htmldir_)/$$d"; \
 	done;
 
 .PHONY: install
 install: | installdirs
 	find man?/ -type f \
 	|while read f; do \
-		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(mandir)/$$f" || exit $$?; \
+		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(mandir)/$$f"; \
 	done;
 
 .PHONY: installdirs
 installdirs:
 	find man?/ -type d \
 	|while read d; do \
-		$(INSTALL_DIR) "$(DESTDIR)$(mandir)/$$d" || exit $$?; \
+		$(INSTALL_DIR) "$(DESTDIR)$(mandir)/$$d"; \
 	done;
 
 .PHONY: uninstall remove
 uninstall remove:
 	find man?/ -type f \
 	|while read f; do \
-		rm -f "$(DESTDIR)$(mandir)/$$f" || exit $$?; \
-		rm -f "$(DESTDIR)$(mandir)/$$f".* || exit $$?; \
+		rm -f "$(DESTDIR)$(mandir)/$$f"; \
+		rm -f "$(DESTDIR)$(mandir)/$$f".*; \
 	done;
 
 .PHONY: uninstall-html
 uninstall-html:
 	find man?/ -type f \
 	|while read f; do \
-		rm -f "$(DESTDIR)$(htmldir_)/$$f".* || exit $$?; \
+		rm -f "$(DESTDIR)$(htmldir_)/$$f".*; \
 	done;
 
 .PHONY: clean
 clean:
 	find man?/ -type f \
 	|while read f; do \
-		rm -f "$(htmlbuilddir)/$$f".* || exit $$?; \
+		rm -f "$(htmlbuilddir)/$$f".*; \
 	done;
 
 # Check if groff reports warnings (may be words of sentences not displayed)
 # from https://lintian.debian.org/tags/groff-message.html
 .PHONY: check-groff-warnings
 check-groff-warnings:
-	GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)" || exit $$?; \
+	GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)"; \
 	for i in man?/*.[1-9]; \
 	do \
 		if grep -q 'SH.*NAME' "$$i"; then \
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 79+ messages in thread

* Re: [PATCH] malloc_usable_size.3: ffix
  2021-05-09 21:39 ` [PATCH] malloc_usable_size.3: ffix Alejandro Colomar
@ 2021-05-09 23:10   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:10 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man3/malloc_usable_size.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/malloc_usable_size.3 b/man3/malloc_usable_size.3
> index 4b4ba3dca..5f892ef6c 100644
> --- a/man3/malloc_usable_size.3
> +++ b/man3/malloc_usable_size.3
> @@ -29,7 +29,7 @@ malloc_usable_size \- obtain size of block of memory allocated from heap
>  .nf
>  .B #include <malloc.h>
>  .PP
> -.BI "size_t malloc_usable_size (void *" ptr );
> +.BI "size_t malloc_usable_size(void *" ptr );
>  .fi
>  .SH DESCRIPTION
>  The
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] getutmp.3: ffix
  2021-05-09 21:39 ` [PATCH] getutmp.3: ffix Alejandro Colomar
@ 2021-05-09 23:10   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:10 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man3/getutmp.3 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/getutmp.3 b/man3/getutmp.3
> index e5e85aced..012cfdf6f 100644
> --- a/man3/getutmp.3
> +++ b/man3/getutmp.3
> @@ -31,8 +31,8 @@ getutmp, getutmpx \- copy utmp structure to utmpx, and vice versa
>  .BR "#define _GNU_SOURCE" "             /* See feature_test_macros(7) */"
>  .B #include <utmpx.h>
>  .PP
> -.BI " void getutmp(const struct utmpx *" ux ", struct utmp *" u );
> -.BI " void getutmpx(const struct utmp *" u ", struct utmpx *" ux );
> +.BI "void getutmp(const struct utmpx *" ux ", struct utmp *" u );
> +.BI "void getutmpx(const struct utmp *" u ", struct utmpx *" ux );
>  .fi
>  .SH DESCRIPTION
>  The
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] on_exit.3: ffix
  2021-05-09 21:39 ` [PATCH] on_exit.3: ffix Alejandro Colomar
@ 2021-05-09 23:11   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:11 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man3/on_exit.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/on_exit.3 b/man3/on_exit.3
> index afcd9f9ed..7997b601e 100644
> --- a/man3/on_exit.3
> +++ b/man3/on_exit.3
> @@ -35,7 +35,7 @@ on_exit \- register a function to be called at normal process termination
>  .nf
>  .B #include <stdlib.h>
>  .PP
> -.BI "int on_exit(void (*" function ")(int , void *), void *" arg );
> +.BI "int on_exit(void (*" function ")(int, void *), void *" arg );
>  .fi
>  .PP
>  .RS -4
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] perror.3: ffix
  2021-05-09 21:39 ` [PATCH] perror.3: ffix Alejandro Colomar
@ 2021-05-09 23:12   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:12 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man3/perror.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/perror.3 b/man3/perror.3
> index ae271f343..e3eec1da3 100644
> --- a/man3/perror.3
> +++ b/man3/perror.3
> @@ -39,7 +39,7 @@ perror \- print a system error message
>  .PP
>  .B #include <errno.h>
>  .PP
> -.BI "const char * const " sys_errlist [];
> +.BI "const char *const " sys_errlist [];
>  .BI "int " sys_nerr ;
>  .BI "int " errno ";       \fR/* Not really declared this way; see errno(3) */"
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] __ppc_get_timebase.3: ffix
  2021-05-09 21:39 ` [PATCH] __ppc_get_timebase.3: ffix Alejandro Colomar
@ 2021-05-09 23:14   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:14 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man3/__ppc_get_timebase.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/__ppc_get_timebase.3 b/man3/__ppc_get_timebase.3
> index 9939767ae..618ca74dc 100644
> --- a/man3/__ppc_get_timebase.3
> +++ b/man3/__ppc_get_timebase.3
> @@ -31,7 +31,7 @@ __ppc_get_timebase, __ppc_get_timebase_freq \- get the current value
>  .nf
>  .B #include <sys/platform/ppc.h>
>  .PP
> -.BI "uint64_t __ppc_get_timebase(void)"
> +.BI "uint64_t __ppc_get_timebase(void);"
>  .BI "uint64_t __ppc_get_timebase_freq(void);"
>  .fi
>  .SH DESCRIPTION
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] strsignal.3: ffix
  2021-05-09 21:39 ` [PATCH] strsignal.3: ffix Alejandro Colomar
@ 2021-05-09 23:14   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:14 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  man3/strsignal.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/strsignal.3 b/man3/strsignal.3
> index cfea6c8b4..6a5a1e610 100644
> --- a/man3/strsignal.3
> +++ b/man3/strsignal.3
> @@ -39,7 +39,7 @@ strsignal, sigdescr_np, sigdescr_np, sys_siglist \- return string describing sig
>  .BI "char *sigdescr_np(int " sig );
>  .BI "char *sigabbrev_np(int " sig );
>  .PP
> -.BI "extern const char * const " sys_siglist [];
> +.BI "extern const char *const " sys_siglist [];
>  .fi
>  .PP
>  .RS -4
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] strsignal.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:39 ` [PATCH] strsignal.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
@ 2021-05-09 23:16   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:16 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> glibc uses 'const' in sigdescr_np(), sigabbrev_np().
> Let's use it here too.
> 
> .../glibc$ grep_glibc_prototype sigdescr_np
> string/string.h:469:
> extern const char *sigdescr_np (int __sig) __THROW;
> .../glibc$ grep_glibc_prototype sigabbrev_np
> string/string.h:466:
> extern const char *sigabbrev_np (int __sig) __THROW;
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael

> ---
>  man3/strsignal.3 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/strsignal.3 b/man3/strsignal.3
> index 6a5a1e610..bc4120303 100644
> --- a/man3/strsignal.3
> +++ b/man3/strsignal.3
> @@ -36,8 +36,8 @@ strsignal, sigdescr_np, sigdescr_np, sys_siglist \- return string describing sig
>  .B #include <string.h>
>  .PP
>  .BI "char *strsignal(int " sig );
> -.BI "char *sigdescr_np(int " sig );
> -.BI "char *sigabbrev_np(int " sig );
> +.BI "const char *sigdescr_np(int " sig );
> +.BI "const char *sigabbrev_np(int " sig );
>  .PP
>  .BI "extern const char *const " sys_siglist [];
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] tzset.3: ffix
  2021-05-09 21:39 ` [PATCH] tzset.3: ffix Alejandro Colomar
@ 2021-05-09 23:16   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:16 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  man3/tzset.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/tzset.3 b/man3/tzset.3
> index e4660be8b..c80da53f8 100644
> --- a/man3/tzset.3
> +++ b/man3/tzset.3
> @@ -37,7 +37,7 @@ tzset, tzname, timezone, daylight \- initialize time conversion information
>  .nf
>  .B #include <time.h>
>  .PP
> -.B void tzset (void);
> +.B void tzset(void);
>  .PP
>  .BI "extern char *" tzname [2];
>  .BI "extern long " timezone ;
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] clone.2: tfix
  2021-05-09 21:39 ` [PATCH] clone.2: tfix Alejandro Colomar
@ 2021-05-09 23:17   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:17 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  man2/clone.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/clone.2 b/man2/clone.2
> index 838fbd669..04b4ec38c 100644
> --- a/man2/clone.2
> +++ b/man2/clone.2
> @@ -969,7 +969,7 @@ mask must also include
>  .B CLONE_VM
>  if
>  .B CLONE_SIGHAND
> -is specified
> +is specified.
>  .TP
>  .BR CLONE_STOPPED " (since Linux 2.6.0)"
>  .\" Precisely: Linux 2.6.0-test2
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const'
  2021-05-09 21:39 ` [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const' Alejandro Colomar
@ 2021-05-09 23:18   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:18 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Neither POSIX or glibc use 'const' in
> pthread_mutexattr_setrobust().
> Remove it.
> 
> .../glibc$ grep_glibc_prototype pthread_mutexattr_setrobust
> sysdeps/htl/pthread.h:355:
> extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
> 					int __robustness)
>      __THROW __nonnull ((1));
> sysdeps/nptl/pthread.h:888:
> extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
> 					int __robustness)
>      __THROW __nonnull ((1));
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>


Applied.

Thanks,

Michael


> ---
>  man3/pthread_mutexattr_setrobust.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/pthread_mutexattr_setrobust.3 b/man3/pthread_mutexattr_setrobust.3
> index dbf429c48..86aab88ed 100644
> --- a/man3/pthread_mutexattr_setrobust.3
> +++ b/man3/pthread_mutexattr_setrobust.3
> @@ -33,7 +33,7 @@ pthread_mutexattr_getrobust, pthread_mutexattr_setrobust
>  .PP
>  .BI "int pthread_mutexattr_getrobust(const pthread_mutexattr_t *" attr ,
>  .BI "                                int *" robustness ");"
> -.BI "int pthread_mutexattr_setrobust(const pthread_mutexattr_t *" attr ,
> +.BI "int pthread_mutexattr_setrobust(pthread_mutexattr_t *" attr ,
>  .BI "                                int " robustness ");"
>  .fi
>  .PP
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:39 ` [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
@ 2021-05-09 23:19   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:19 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> glibc uses 'const' in pthread_setattr_default_np().
> Let's use it here too.


Applied.

Thanks,

Michael


> 
> .../glibc$ grep_glibc_prototype pthread_setattr_default_np
> sysdeps/nptl/pthread.h:406:
> extern int pthread_setattr_default_np (const pthread_attr_t *__attr)
>      __THROW __nonnull ((1));
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man3/pthread_getattr_default_np.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/pthread_getattr_default_np.3 b/man3/pthread_getattr_default_np.3
> index 903d5095a..5973af5ec 100644
> --- a/man3/pthread_getattr_default_np.3
> +++ b/man3/pthread_getattr_default_np.3
> @@ -32,7 +32,7 @@ get or set default thread-creation attributes
>  .B #include <pthread.h>
>  .PP
>  .BI "int pthread_getattr_default_np(pthread_attr_t *" attr );
> -.BI "int pthread_setattr_default_np(pthread_attr_t *" attr );
> +.BI "int pthread_setattr_default_np(const pthread_attr_t *" attr );
>  .PP
>  Compile and link with \fI\-pthread\fP.
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] sched_get_priority_max.2, open_memstream.3: tfix
  2021-05-09 21:39 ` [PATCH] sched_get_priority_max.2, open_memstream.3: tfix Alejandro Colomar
@ 2021-05-09 23:19   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:19 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  man2/sched_get_priority_max.2 | 2 +-
>  man3/open_memstream.3         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man2/sched_get_priority_max.2 b/man2/sched_get_priority_max.2
> index 8a857f6e7..2afd88681 100644
> --- a/man2/sched_get_priority_max.2
> +++ b/man2/sched_get_priority_max.2
> @@ -80,7 +80,7 @@ thus it is a good idea for portable applications to use a virtual
>  priority range and map it to the interval given by
>  .BR sched_get_priority_max ()
>  and
> -.BR sched_get_priority_min
> +.BR sched_get_priority_min ()
>  POSIX.1 requires
>  .\" POSIX.1-2001, POSIX.1-2008 (XBD 2.8.4)
>  a spread of at least 32 between the maximum and the minimum values for
> diff --git a/man3/open_memstream.3 b/man3/open_memstream.3
> index ba6cbfa75..ea1489cb8 100644
> --- a/man3/open_memstream.3
> +++ b/man3/open_memstream.3
> @@ -110,7 +110,7 @@ l l l.
>  Interface	Attribute	Value
>  T{
>  .BR open_memstream (),
> -.BR open_wmemstream
> +.BR open_wmemstream ()
>  T}	Thread safety	MT-Safe
>  .TE
>  .hy
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] dladdr.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:38 ` [PATCH] dladdr.3: " Alejandro Colomar
@ 2021-05-09 23:20   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:20 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:38 AM, Alejandro Colomar wrote:
> Glibc uses 'const' for the 1st parameter of these functions.
> Fix the prototypes.

Applied.

Thanks,

Michael


> ......
> 
> .../glibc$ grep_glibc_prototype dladdr
> dlfcn/dlfcn.h:98:
> extern int dladdr (const void *__address, Dl_info *__info)
>      __THROW __nonnull ((2));
> .../glibc$ grep_glibc_prototype dladdr1
> dlfcn/dlfcn.h:102:
> extern int dladdr1 (const void *__address, Dl_info *__info,
> 		    void **__extra_info, int __flags) __THROW __nonnull ((2));
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man3/dladdr.3 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/man3/dladdr.3 b/man3/dladdr.3
> index 19944174b..c95df4e49 100644
> --- a/man3/dladdr.3
> +++ b/man3/dladdr.3
> @@ -31,9 +31,9 @@ dladdr, dladdr1 \- translate address to symbolic information
>  .B #define _GNU_SOURCE
>  .B #include <dlfcn.h>
>  .PP
> -.BI "int dladdr(void *" addr ", Dl_info *" info );
> -.BI "int dladdr1(void *" addr ", Dl_info *" info ", void **" \
> -        extra_info ", int " flags );
> +.BI "int dladdr(const void *" addr ", Dl_info *" info );
> +.BI "int dladdr1(const void *" addr ", Dl_info *" info ", void **" extra_info ,
> +.BI "            int " flags );
>  .PP
>  Link with \fI\-ldl\fP.
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged()
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
@ 2021-05-09 23:27   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:27 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:38 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. (I take these patches to your own scripts on trust...)

Thanks,

Michael


> ---
>  scripts/bash_aliases      | 17 ++++++++++++++++-
>  scripts/modified_pages.sh | 34 ----------------------------------
>  2 files changed, 16 insertions(+), 35 deletions(-)
>  delete mode 100755 scripts/modified_pages.sh
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index a14c65cd4..8cedc4efc 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  ########################################################################
>  #
> -# (C) Copyright 2021, Alejandro Colomar
> +# (C) Copyright 2020, 2021, Alejandro Colomar
>  # These functions are free software; you can redistribute them and/or
>  # modify them under the terms of the GNU General Public License
>  # as published by the Free Software Foundation; version 2.
> @@ -147,6 +147,21 @@ function pdfman()
>  	xdg-open ${tmp};
>  }
>  
> +#  man_gitstaged  prints a list of all files with changes staged for commit
> +# (basename only if the files are within <man?/>), separated by ", ".
> +# Usage example:  .../man-pages$ git commit -m "$(man_gitstaged): msg";
> +
> +function man_gitstaged()
> +{
> +	git status							\
> +	|sed "/Changes not staged for commit:/q"			\
> +	|grep -E "^\s*(modified|deleted|new file):"			\
> +	|sed "s/^.*:\s*/, /"						\
> +	|sed "s%man[1-9]/%%"						\
> +	|tr -d '\n'							\
> +	|sed "s/^, //"
> +}
> +
>  ########################################################################
>  #	Glibc
>  
> diff --git a/scripts/modified_pages.sh b/scripts/modified_pages.sh
> deleted file mode 100755
> index f6c4a6cea..000000000
> --- a/scripts/modified_pages.sh
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -#!/bin/bash
> -
> -## SPDX-License-Identifier: GPL-2.0-only
> -########################################################################
> -##
> -## (C) Copyright 2020, Alejandro Colomar
> -## This program is free software; you can redistribute it and/or
> -## modify it under the terms of the GNU General Public License
> -## as published by the Free Software Foundation; version 2.
> -##
> -## This program is distributed in the hope that it will be useful,
> -## but WITHOUT ANY WARRANTY; without even the implied warranty of
> -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> -## GNU General Public License for more details
> -## (http://www.gnu.org/licenses/gpl-2.0.html).
> -##
> -########################################################################
> -##
> -## The output of this script is a
> -## list of all files with changes staged for commit
> -## (basename only if the files are within "man?/"),
> -## separated by ", ".
> -## Usage:
> -## git commit -m "$(./scripts/modified_pages.sh): Short message here"
> -##
> -
> -
> -git status							\
> -|sed "/Changes not staged for commit:/q"			\
> -|grep -E "^\s*(modified|deleted|new file):"			\
> -|sed "s/^.*:\s*/, /"						\
> -|sed "s%man[1-9]/%%"						\
> -|tr -d '\n'							\
> -|sed "s/^, //"
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command
  2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
@ 2021-05-09 23:31   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:31 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, Jakub Wilk

Hi Alex,

On 5/10/21 9:38 AM, Alejandro Colomar wrote:
> The output of 'git status' is not stable.
> 
> The more stable 'git status --porcelain' is more complex,
> and scripting around it would be more complex.
> 
> However, 'git diff --staged --name-only' produces
> the output that we were lookiong for.
> 
> Reported-by: Jakub Wilk <jwilk@jwilk.net>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>


Applied.

Thanks,

Michael


> ---
>  scripts/bash_aliases | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index 8cedc4efc..d9b6047d1 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -153,13 +153,11 @@ function pdfman()
>  
>  function man_gitstaged()
>  {
> -	git status							\
> -	|sed "/Changes not staged for commit:/q"			\
> -	|grep -E "^\s*(modified|deleted|new file):"			\
> -	|sed "s/^.*:\s*/, /"						\
> +	git diff --staged --name-only					\
> +	|sed "s/$/, /"							\
>  	|sed "s%man[1-9]/%%"						\
>  	|tr -d '\n'							\
> -	|sed "s/^, //"
> +	|sed "s/, $//"
>  }
>  
>  ########################################################################
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments().
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments() Alejandro Colomar
@ 2021-05-09 23:32   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:32 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> This patch makes man_lsfunc() search for the function prototypes,
> instead of relying on the current manual page formatting,
> which might change in the future, and break this function.
> 
> It also simplifies the code, by reusing man_section().
> 
> Create a new function sed_rm_ccomments(), which is needed by
> man_lsfunc(), and may also be useful in other cases.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  scripts/bash_aliases | 39 +++++++++++++++++++++------------------
>  1 file changed, 21 insertions(+), 18 deletions(-)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index d9b6047d1..c50108a16 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -20,6 +20,21 @@
>  EX_OK=0;
>  EX_USAGE=64;
>  
> +########################################################################
> +#	C
> +
> +#  sed_rm_ccomments()  removes C comments.
> +# It can't handle multiple comments in a sinlge line correctly,
> +# nor mixed or embedded //... and /*...*/ comments.
> +# Use as a filter (see man_lsfunc() in this file).
> +
> +function sed_rm_ccomments()
> +{
> +	sed 's%/\*.*\*/%%' \
> +	|sed -E '\%/\*%,\%\*/%{\%(\*/|/\*)%!d; s%/\*.*%%; s%.*\*/%%;}' \
> +	|sed 's%//.*%%';
> +}
> +
>  ########################################################################
>  #	Linux kernel
>  
> @@ -106,25 +121,13 @@ function man_lsfunc()
>  		return ${EX_USAGE};
>  	fi
>  
> -	find "${@}" -type f \
> -	|xargs grep -l "\.SH SYNOPSIS" \
> -	|sort -V \
> -	|while read -r manpage; do
> -		<${manpage} \
> -		sed -n \
> -			-e '/^\.TH/,/^\.SH/{/^\.SH/!p}' \
> -			-e "/^\.SH SYNOPSIS/p" \
> -			-e "/^\.SH SYNOPSIS/,/^\.SH/{/^\.SH/!p}" \
> -		|sed \
> -			-e '/Feature/,$d' \
> -			-e '/{/,/}/d' \
> -		|man -P cat -l - 2>/dev/null;
> +	for arg in "$@"; do
> +		man_section "${arg}" 'SYNOPSIS';
>  	done \
> -	|sed -n "/^SYNOPSIS/,/^\w/p" \
> -	|grep '^       \w' \
> -	|grep -v ':' \
> -	|sed 's/^[^(]* \**\(\w*\)(.*/\1/' \
> -	|grep '^\w' \
> +	|sed_rm_ccomments \
> +	|pcregrep -Mn '(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]+?(...)?\s*\); *$' \
> +	|grep '^[0-9]' \
> +	|sed -E 's/^[^(]+ \**(\w+)\(.*/\1/' \
>  	|uniq;
>  }
>  
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables Alejandro Colomar
@ 2021-05-09 23:32   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:32 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  scripts/bash_aliases | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index c50108a16..813c00960 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -131,6 +131,33 @@ function man_lsfunc()
>  	|uniq;
>  }
>  
> +#  man_lsvar()  prints the name of all C variables declared in the SYNOPSIS
> +# of all manual pages in a directory (or in a single manual page file).
> +# Each name is printed in a separate line
> +# Usage example:  .../man-pages$ man_lsvar man3;
> +
> +function man_lsvar()
> +{
> +	if ! [ -v 1 ]; then
> +		>&2 echo "Usage: ${FUNCNAME[0]} <dir>";
> +		return ${EX_USAGE};
> +	fi
> +
> +	for arg in "$@"; do
> +		man_section "${arg}" 'SYNOPSIS';
> +	done \
> +	|sed_rm_ccomments \
> +	|pcregrep -Mv '(?s)^ [\w ]+ \**\w+\([\w\s(,)[\]*]+?(...)?\s*\); *$' \
> +	|pcregrep -Mn \
> +	  -e '(?s)^ +extern [\w ]+ \**\(\*+[\w ]+\)\([\w\s(,)[\]*]+?\s*\); *$' \
> +	  -e '^ +extern [\w ]+ \**[\w ]+; *$' \
> +	|grep '^[0-9]' \
> +	|grep -v 'typedef' \
> +	|sed -E 's/^[0-9]+: +extern [^(]+ \**\(\*+(\w* )?(\w+)\)\(.*/\2/' \
> +	|sed    's/^[0-9]\+: \+extern .* \**\(\w\+\); */\1/' \
> +	|uniq;
> +}
> +
>  #  pdfman()  renders a manual page in PDF
>  # Usage example:  .../man-pages$ pdfman man2/membarrier.2;
>  
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections Alejandro Colomar
@ 2021-05-09 23:33   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:33 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  scripts/bash_aliases | 29 +++++++++++++++++++----------
>  1 file changed, 19 insertions(+), 10 deletions(-)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index 813c00960..7b1b7da9c 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -85,26 +85,35 @@ function grep_syscall_def()
>  ########################################################################
>  #	Linux man-pages
>  
> -#  man_section()  prints a specific manual page section (DESCRIPTION, SYNOPSIS,
> +#  man_section()  prints specific manual page sections (DESCRIPTION, SYNOPSIS,
>  # ...) of all manual pages in a directory (or in a single manual page file).
> -# Usage example:  .../man-pages$ man_section man2 SYNOPSIS;
> +# Usage example:  .../man-pages$ man_section man2 SYNOPSIS 'CONFORMING TO';
>  
>  function man_section()
>  {
>  	if ! [ -v 2 ]; then
> -		>&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>";
> +		>&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>...";
>  		return ${EX_USAGE};
>  	fi
>  
> -	find "${1}" -type f \
> -	|xargs grep -l "\.SH ${2}" \
> +	local page="$1";
> +	shift;
> +	local sect="$@";
> +
> +	find "${page}" -type f \
> +	|xargs wc -l \
> +	|grep -v -e '\b1 ' -e '\btotal\b' \
> +	|awk '{ print $2 }' \
>  	|sort -V \
>  	|while read -r manpage; do
> -		<${manpage} \
> -		sed -n \
> -			-e '/^\.TH/,/^\.SH/{/^\.SH/!p}' \
> -			-e "/^\.SH ${2}/p" \
> -			-e "/^\.SH ${2}/,/^\.SH/{/^\.SH/!p}" \
> +		cat \
> +		<(<${manpage} sed -n '/^\.TH/,/^\.SH/{/^\.SH/!p}') \
> +		<(for s in ${sect}; do
> +			<${manpage} \
> +			sed -n \
> +				-e "/^\.SH ${s}/p" \
> +				-e "/^\.SH ${s}/,/^\.SH/{/^\.SH/!p}"; \
> +		  done;) \
>  		|man -P cat -l - 2>/dev/null;
>  	done;
>  }
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases: Fix error messages
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Fix error messages Alejandro Colomar
@ 2021-05-09 23:33   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:33 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Fix the error messages to clearly show that both dirs and manual
> pages are accepted, and that more than one argument is accepted.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>


Applied.

Thanks,

Michael


> ---
>  scripts/bash_aliases | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index 7b1b7da9c..a14026bda 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -126,7 +126,7 @@ function man_section()
>  function man_lsfunc()
>  {
>  	if ! [ -v 1 ]; then
> -		>&2 echo "Usage: ${FUNCNAME[0]} <dir>";
> +		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
>  		return ${EX_USAGE};
>  	fi
>  
> @@ -148,7 +148,7 @@ function man_lsfunc()
>  function man_lsvar()
>  {
>  	if ! [ -v 1 ]; then
> -		>&2 echo "Usage: ${FUNCNAME[0]} <dir>";
> +		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
>  		return ${EX_USAGE};
>  	fi
>  
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] scripts/bash_aliases: srcfix
  2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: srcfix Alejandro Colomar
@ 2021-05-09 23:34   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:34 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> I clarified the code about two things:
> 
> - Checking how many arguments are being passed.
>     Here, some functions didn't reject extra arguments when they
>     weren't being used.  Fix that.
>     I also changed the code to use $#, which is more explicit.
>     And use arithmetic expressions, which better indicate that
>     we're dealing with numbers.
> 
> - Remove unneeded options from sort.
>     Reported-by: Stefan Puiu <stefan.puiu@gmail.com>
>     After Stefan asked about why am I using 'sort -V',
>     I noticed that I really don't need '-V', and it may confuse
>     people trying to understand the script, so even though I
>     slightly prefer the output of 'sort -V', in this case, it's
>     better to use the simpler 'sort' (yet I need 'sort', to
>     maintain consistency in the results (find is quite random)).
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  scripts/bash_aliases | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/scripts/bash_aliases b/scripts/bash_aliases
> index a14026bda..358e2f37a 100644
> --- a/scripts/bash_aliases
> +++ b/scripts/bash_aliases
> @@ -45,20 +45,20 @@ function sed_rm_ccomments()
>  
>  function grep_syscall()
>  {
> -	if ! [ -v 1 ]; then
> +	if (($# != 1)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
>  		return ${EX_USAGE};
>  	fi
>  
>  	find * -type f \
>  	|grep '\.c$' \
> -	|sort -V \
> +	|sort \
>  	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
>  	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
>  
>  	find * -type f \
>  	|grep '\.[ch]$' \
> -	|sort -V \
> +	|sort \
>  	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
>  	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
>  }
> @@ -70,14 +70,14 @@ function grep_syscall()
>  
>  function grep_syscall_def()
>  {
> -	if ! [ -v 1 ]; then
> +	if (($# != 1)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
>  		return ${EX_USAGE};
>  	fi
>  
>  	find * -type f \
>  	|grep '\.c$' \
> -	|sort -V \
> +	|sort \
>  	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?^}" \
>  	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
>  }
> @@ -91,7 +91,7 @@ function grep_syscall_def()
>  
>  function man_section()
>  {
> -	if ! [ -v 2 ]; then
> +	if (($# < 2)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <dir> <section>...";
>  		return ${EX_USAGE};
>  	fi
> @@ -104,7 +104,7 @@ function man_section()
>  	|xargs wc -l \
>  	|grep -v -e '\b1 ' -e '\btotal\b' \
>  	|awk '{ print $2 }' \
> -	|sort -V \
> +	|sort \
>  	|while read -r manpage; do
>  		cat \
>  		<(<${manpage} sed -n '/^\.TH/,/^\.SH/{/^\.SH/!p}') \
> @@ -125,7 +125,7 @@ function man_section()
>  
>  function man_lsfunc()
>  {
> -	if ! [ -v 1 ]; then
> +	if (($# < 1)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
>  		return ${EX_USAGE};
>  	fi
> @@ -147,7 +147,7 @@ function man_lsfunc()
>  
>  function man_lsvar()
>  {
> -	if ! [ -v 1 ]; then
> +	if (($# < 1)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <manpage|manNdir>...";
>  		return ${EX_USAGE};
>  	fi
> @@ -172,7 +172,7 @@ function man_lsvar()
>  
>  function pdfman()
>  {
> -	if ! [ -v 1 ]; then
> +	if (($# != 1)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <man-page.n>";
>  		return ${EX_USAGE};
>  	fi;
> @@ -209,14 +209,14 @@ function man_gitstaged()
>  
>  function grep_glibc_prototype()
>  {
> -	if ! [ -v 1 ]; then
> +	if (($# != 1)); then
>  		>&2 echo "Usage: ${FUNCNAME[0]} <func>";
>  		return ${EX_USAGE};
>  	fi
>  
>  	find * -type f \
>  	|grep '\.h$' \
> -	|sort -V \
> +	|sort \
>  	|xargs pcregrep -Mn \
>  	  "(?s)^[\w[][\w\s(,)[:\]]+\s+\**${1}\s*\([\w\s(,)[\]*]+?(...)?\)[\w\s(,)[:\]]*;" \
>  	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] Makefile: Fix bug when running in parallel
  2021-05-09 21:39 ` [PATCH] Makefile: Fix bug when running in parallel Alejandro Colomar
@ 2021-05-09 23:39   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:39 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Prerequisites can run in parallel.  This wouldn't make any sense
> when uninstalling and installing again.
> 
> For that, use consecutive commands, which run one after the other
> even with multiple cores.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  Makefile | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 430090801..fdfaf9645 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -20,7 +20,9 @@ INSTALL_DATA = $(INSTALL) -m 644
>  INSTALL_DIR = $(INSTALL) -m 755 -d
>  
>  .PHONY: all
> -all: remove install
> +all:
> +	$(MAKE) uninstall;
> +	$(MAKE) install;
>  
>  # Use with
>  #  make HTOPTS=whatever html
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] Makefile: Simplify error handling
  2021-05-09 21:39 ` [PATCH] Makefile: Simplify error handling Alejandro Colomar
@ 2021-05-09 23:45   ` Michael Kerrisk (man-pages)
  2021-05-10  6:53     ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:45 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Instead of having to write '|| exit $$?' all the time,
> use the shell's '-Eeuo pipefail' options, which handle
> errors even better.  However, pipefail needs bash,
> so POSIX sh (default) is not valid.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
> 
> Hi Michael,
> 
> I'm not sure how much POSIX sh compatibility is needed for the man pages
> Makefile.  There are probably projects out there that don't have bash,
> and still want to use it.  So maybe we should't apply this.  I don't know.
> Up to you.

I think I'll skip this one. I'm not sure if it might cause some
problem for Debian, where the default shall is dash(1), I believe.

Thanks,

Michael

>  Makefile | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index fdfaf9645..4df4f5846 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,4 +1,5 @@
>  #!/usr/bin/make -f
> +SHELL = /bin/bash -Eeuo pipefail
>  
>  # Do not print "Entering directory ..."
>  MAKEFLAGS += --no-print-directory
> @@ -33,15 +34,14 @@ html: | builddirs-html
>  	|while read f; do \
>  		man2html $(HTOPTS) "$$f" \
>  		|sed -e '1,2d' \
> -		>"$(htmlbuilddir)/$${f}$(htmlext)" \
> -			|| exit $$?; \
> +		>"$(htmlbuilddir)/$${f}$(htmlext)"; \
>  	done;
>  
>  .PHONY: builddirs-html
>  builddirs-html:
>  	find man?/ -type d \
>  	|while read d; do \
> -		$(INSTALL_DIR) "$(htmlbuilddir)/$$d" || exit $$?; \
> +		$(INSTALL_DIR) "$(htmlbuilddir)/$$d"; \
>  	done;
>  
>  .PHONY: install-html
> @@ -49,57 +49,57 @@ install-html: | installdirs-html
>  	cd $(htmlbuilddir) && \
>  	find man?/ -type f \
>  	|while read f; do \
> -		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(htmldir_)/$$f" || exit $$?; \
> +		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(htmldir_)/$$f"; \
>  	done;
>  
>  .PHONY: installdirs-html
>  installdirs-html:
>  	find man?/ -type d \
>  	|while read d; do \
> -		$(INSTALL_DIR) "$(DESTDIR)$(htmldir_)/$$d" || exit $$?; \
> +		$(INSTALL_DIR) "$(DESTDIR)$(htmldir_)/$$d"; \
>  	done;
>  
>  .PHONY: install
>  install: | installdirs
>  	find man?/ -type f \
>  	|while read f; do \
> -		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(mandir)/$$f" || exit $$?; \
> +		$(INSTALL_DATA) -T "$$f" "$(DESTDIR)$(mandir)/$$f"; \
>  	done;
>  
>  .PHONY: installdirs
>  installdirs:
>  	find man?/ -type d \
>  	|while read d; do \
> -		$(INSTALL_DIR) "$(DESTDIR)$(mandir)/$$d" || exit $$?; \
> +		$(INSTALL_DIR) "$(DESTDIR)$(mandir)/$$d"; \
>  	done;
>  
>  .PHONY: uninstall remove
>  uninstall remove:
>  	find man?/ -type f \
>  	|while read f; do \
> -		rm -f "$(DESTDIR)$(mandir)/$$f" || exit $$?; \
> -		rm -f "$(DESTDIR)$(mandir)/$$f".* || exit $$?; \
> +		rm -f "$(DESTDIR)$(mandir)/$$f"; \
> +		rm -f "$(DESTDIR)$(mandir)/$$f".*; \
>  	done;
>  
>  .PHONY: uninstall-html
>  uninstall-html:
>  	find man?/ -type f \
>  	|while read f; do \
> -		rm -f "$(DESTDIR)$(htmldir_)/$$f".* || exit $$?; \
> +		rm -f "$(DESTDIR)$(htmldir_)/$$f".*; \
>  	done;
>  
>  .PHONY: clean
>  clean:
>  	find man?/ -type f \
>  	|while read f; do \
> -		rm -f "$(htmlbuilddir)/$$f".* || exit $$?; \
> +		rm -f "$(htmlbuilddir)/$$f".*; \
>  	done;
>  
>  # Check if groff reports warnings (may be words of sentences not displayed)
>  # from https://lintian.debian.org/tags/groff-message.html
>  .PHONY: check-groff-warnings
>  check-groff-warnings:
> -	GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)" || exit $$?; \
> +	GROFF_LOG="$$(mktemp --tmpdir manpages-checksXXXX)"; \
>  	for i in man?/*.[1-9]; \
>  	do \
>  		if grep -q 'SH.*NAME' "$$i"; then \
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] system_data_types.7: tfix
  2021-05-09 21:39 ` [PATCH] system_data_types.7: tfix Alejandro Colomar
@ 2021-05-09 23:46   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:46 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Those pages didn't exist.  Fix the section number.
> I noticed the typo thanks to the HTML pages on man7.org.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>


Applied.

Thanks,

Michael



> ---
>  man7/system_data_types.7 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/man7/system_data_types.7 b/man7/system_data_types.7
> index e038aab1e..ddabefd16 100644
> --- a/man7/system_data_types.7
> +++ b/man7/system_data_types.7
> @@ -374,7 +374,7 @@ POSIX.1-2001 and later.
>  .BR getegid (2),
>  .BR getgroups (2),
>  .BR getresgid (2),
> -.BR getgrnam (2),
> +.BR getgrnam (3),
>  .BR credentials (7)
>  .RE
>  .\"------------------------------------- id_t -------------------------/
> @@ -675,7 +675,7 @@ C11 and later; POSIX.1-2001 and later.
>  .IR "See also" :
>  .BR setlocale (3),
>  .BR localeconv (3),
> -.BR charsets (5),
> +.BR charsets (7),
>  .BR locale (7)
>  .RE
>  .\"------------------------------------- ldiv_t -----------------------/
> @@ -1534,7 +1534,7 @@ POSIX.1-2001 and later.
>  .BR getuid (2),
>  .BR geteuid (2),
>  .BR getresuid (2),
> -.BR getpwnam (2),
> +.BR getpwnam (3),
>  .BR credentials (7)
>  .RE
>  .\"------------------------------------- uintmax_t --------------------/
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] cpow.3: Use 'complex' after the type consistently
  2021-05-09 21:39 ` [PATCH] cpow.3: Use 'complex' after the type consistently Alejandro Colomar
@ 2021-05-09 23:49   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:49 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied.

Thanks,

Michael


> ---
>  man3/cpow.3 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/man3/cpow.3 b/man3/cpow.3
> index 494b88f74..be93bff74 100644
> --- a/man3/cpow.3
> +++ b/man3/cpow.3
> @@ -11,10 +11,10 @@ cpow, cpowf, cpowl \- complex power function
>  .nf
>  .B #include <complex.h>
>  .PP
> -.BI "double complex cpow(double complex " x ", complex double " z ");"
> -.BI "float complex cpowf(float complex " x ", complex float " z ");"
> +.BI "double complex cpow(double complex " x ", double complex " z );
> +.BI "float complex cpowf(float complex " x ", float complex " z );
>  .BI "long double complex cpowl(long double complex " x ,
> -.BI "                          complex long double " z ");"
> +.BI "                          long double complex " z );
>  .PP
>  Link with \fI\-lm\fP.
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.)
  2021-05-09 21:39 ` [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.) Alejandro Colomar
@ 2021-05-09 23:50   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:50 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Fix the types for the following functions:
> 
> authunix_create(),
> callrpc(),
> clnt_create(),
> clnt_pcreateerror(),
> clnt_perror(),
> clnt_spcreateerror(),
> clnt_sperror(),
> pmap_set(),
> svc_register(),
> svcerr_progvers().
> 
> .../glibc$ grep_glibc_prototype authunix_create
> sunrpc/rpc/auth.h:158:
> extern AUTH *authunix_create (char *__machname, __uid_t __uid, __gid_t __gid,
> 			      int __len, __gid_t *__aup_gids);
> .../glibc$ grep_glibc_prototype callrpc
> sunrpc/rpc/clnt.h:359:
> extern int callrpc (const char *__host, const u_long __prognum,
> 		    const u_long __versnum, const u_long __procnum,
> 		    const xdrproc_t __inproc, const char *__in,
> 		    const xdrproc_t __outproc, char *__out) __THROW;
> .../glibc$ grep_glibc_prototype clnt_create
> sunrpc/rpc/clnt.h:291:
> extern CLIENT *clnt_create (const char *__host, const u_long __prog,
> 			    const u_long __vers, const char *__prot)
>      __THROW;
> .../glibc$ grep_glibc_prototype clnt_pcreateerror
> sunrpc/rpc/clnt.h:368:
> extern void clnt_pcreateerror (const char *__msg);	/* stderr */
> .../glibc$ grep_glibc_prototype clnt_perror
> sunrpc/rpc/clnt.h:379:
> extern void clnt_perror (CLIENT *__clnt, const char *__msg);
> .../glibc$ grep_glibc_prototype clnt_spcreateerror
> sunrpc/rpc/clnt.h:369:
> extern char *clnt_spcreateerror(const char *__msg) __THROW;	/* string */
> .../glibc$ grep_glibc_prototype clnt_sperror
> sunrpc/rpc/clnt.h:381:
> extern char *clnt_sperror (CLIENT *__clnt, const char *__msg) __THROW;
> .../glibc$ grep_glibc_prototype pmap_set
> sunrpc/rpc/pmap_clnt.h:69:
> extern bool_t pmap_set (const u_long __program, const u_long __vers,
> 			int __protocol, u_short __port) __THROW;
> .../glibc$ grep_glibc_prototype svc_register
> sunrpc/rpc/svc.h:188:
> extern bool_t svc_register (SVCXPRT *__xprt, rpcprog_t __prog,
> 			    rpcvers_t __vers, __dispatch_fn_t __dispatch,
> 			    rpcprot_t __protocol) __THROW;
> .../glibc$ grep_glibc_prototype svcerr_progvers
> sunrpc/rpc/svc.h:253:
> extern void	svcerr_progvers (SVCXPRT *__xprt, rpcvers_t __low_vers,
> 				 rpcvers_t __high_vers) __THROW;
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. Thanks!

Cheers,

Michael

> ---
>  man3/rpc.3 | 25 +++++++++++++------------
>  1 file changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/man3/rpc.3 b/man3/rpc.3
> index 1daaaad7e..3d2fe4243 100644
> --- a/man3/rpc.3
> +++ b/man3/rpc.3
> @@ -70,8 +70,8 @@ information with each remote procedure call.
>  This is the default authentication used by RPC.
>  .PP
>  .nf
> -.BI "AUTH *authunix_create(char *" host ", int " uid ", int " gid ,
> -.BI "                      int " len ", int *" aup_gids );
> +.BI "AUTH *authunix_create(char *" host ", uid_t " uid ", gid_t " gid ,
> +.BI "                      int " len ", gid_t *" aup_gids );
>  .fi
>  .IP
>  Create and return an RPC authentication handle that contains
> @@ -100,7 +100,7 @@ with the appropriate parameters.
>  .nf
>  .BI "int callrpc(char *" host ", unsigned long " prognum ,
>  .BI "            unsigned long " versnum ", unsigned long " procnum ,
> -.BI "            xdrproc_t " inproc ", char *" in ,
> +.BI "            xdrproc_t " inproc ", const char *" in ,
>  .BI "            xdrproc_t " outproc ", char *" out );
>  .fi
>  .IP
> @@ -216,8 +216,8 @@ If the RPC library opened the associated socket, it will close it also.
>  Otherwise, the socket remains open.
>  .PP
>  .nf
> -.BI "CLIENT *clnt_create(char *" host ", unsigned long " prog ,
> -.BI "                    unsigned long " vers ", char *" proto );
> +.BI "CLIENT *clnt_create(const char *" host ", unsigned long " prog ,
> +.BI "                    unsigned long " vers ", const char *" proto );
>  .fi
>  .IP
>  Generic client creation routine.
> @@ -305,7 +305,7 @@ handle to the structure at address
>  .IR errp .
>  .PP
>  .nf
> -.BI "void clnt_pcreateerror(char *" s );
> +.BI "void clnt_pcreateerror(const char *" s );
>  .fi
>  .IP
>  Print a message to standard error indicating why a client RPC
> @@ -332,7 +332,7 @@ Used after
>  .BR callrpc ().
>  .PP
>  .nf
> -.BI "clnt_perror(CLIENT *" clnt ", char *" s );
> +.BI "clnt_perror(CLIENT *" clnt ", const char *" s );
>  .fi
>  .IP
>  Print a message to standard error indicating why an RPC call failed;
> @@ -345,7 +345,7 @@ Used after
>  .BR clnt_call ().
>  .PP
>  .nf
> -.BI "char *clnt_spcreateerror(char *" s );
> +.BI "char *clnt_spcreateerror(const char *" s );
>  .fi
>  .IP
>  Like
> @@ -383,7 +383,7 @@ returns pointer to static data, but the
>  result will not get overwritten on each call.
>  .PP
>  .nf
> -.BI "char *clnt_sperror(CLIENT *" rpch ", char *" s );
> +.BI "char *clnt_sperror(CLIENT *" rpch ", const char *" s );
>  .fi
>  .IP
>  Like
> @@ -601,7 +601,7 @@ See also
>  .PP
>  .nf
>  .BI "bool_t pmap_set(unsigned long " prognum ", unsigned long " versnum ,
> -.BI "                unsigned int " protocol ", unsigned short " port );
> +.BI "                int " protocol ", unsigned short " port );
>  .fi
>  .IP
>  A user interface to the
> @@ -781,7 +781,7 @@ This interface is obsoleted by
>  .nf
>  .BI "bool_t svc_register(SVCXPRT *" xprt ", unsigned long " prognum ,
>  .BI "                    unsigned long " versnum ,
> -.BI "                    void (*" dispatch ")(svc_req *, SVCXPRT *),"
> +.BI "                    void (*" dispatch ")(struct svc_req *, SVCXPRT *),"
>  .BI "                    unsigned long " protocol );
>  .fi
>  .IP
> @@ -894,7 +894,8 @@ Called when the desired program is not registered with the RPC package.
>  Service implementors usually do not need this routine.
>  .PP
>  .nf
> -.BI "void svcerr_progvers(SVCXPRT *" xprt );
> +.BI "void svcerr_progvers(SVCXPRT *" xprt ", unsigned long " low_vers ,
> +.BI "                     unsigned long " high_vers );
>  .fi
>  .IP
>  Called when the desired version of a program is not registered
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] xdr.3: SYNOPSIS: Fix prototype types
  2021-05-09 21:39 ` [PATCH] xdr.3: SYNOPSIS: Fix prototype types Alejandro Colomar
@ 2021-05-09 23:51   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:51 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Use the same types glibc uses, and add a missing 'const'.
> 
> .../glibc$ grep_glibc_prototype xdr_union
> sunrpc/rpc/xdr.h:315:
> extern bool_t xdr_union (XDR *__xdrs, enum_t *__dscmp, char *__unp,
> 			 const struct xdr_discrim *__choices,
> 			 xdrproc_t __dfault) __THROW;
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. Thanks!

Cheers,

Michael

> ---
>  man3/xdr.3 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/xdr.3 b/man3/xdr.3
> index ea6359787..83f668dc9 100644
> --- a/man3/xdr.3
> +++ b/man3/xdr.3
> @@ -460,8 +460,8 @@ integers and their external representations.
>  This routine returns one if it succeeds, zero otherwise.
>  .PP
>  .nf
> -.BI "bool_t xdr_union(XDR *" xdrs ", int *" dscmp ", char *" unp ,
> -.BI "                 struct xdr_discrim *" choices ,
> +.BI "bool_t xdr_union(XDR *" xdrs ", enum_t *" dscmp ", char *" unp ,
> +.BI "                 const struct xdr_discrim *" choices ,
>  .BI "                 xdrproc_t " defaultarm ");     /* may equal NULL */"
>  .fi
>  .IP
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS
  2021-05-09 21:39 ` [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS Alejandro Colomar
@ 2021-05-09 23:52   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:52 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> 'C library/kernel differences' was added to BUGS incorrectly.
> Fix it
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. Thanks!

Cheers,

Michael

> ---
>  man2/epoll_wait.2 | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/man2/epoll_wait.2 b/man2/epoll_wait.2
> index f9b5749df..69c79d6ec 100644
> --- a/man2/epoll_wait.2
> +++ b/man2/epoll_wait.2
> @@ -285,18 +285,6 @@ instance whose interest list is currently empty
>  or removed from the interest in another thread).
>  The call will block until some file descriptor is later added to the
>  interest list (in another thread) and that file descriptor becomes ready.
> -.SH BUGS
> -In kernels before 2.6.37, a
> -.I timeout
> -value larger than approximately
> -.I LONG_MAX / HZ
> -milliseconds is treated as \-1 (i.e., infinity).
> -Thus, for example, on a system where
> -.I sizeof(long)
> -is 4 and the kernel
> -.I HZ
> -value is 1000,
> -this means that timeouts greater than 35.79 minutes are treated as infinity.
>  .SS C library/kernel differences
>  The raw
>  .BR epoll_pwait ()
> @@ -312,6 +300,18 @@ The glibc
>  wrapper function specifies this argument as a fixed value
>  (equal to
>  .IR sizeof(sigset_t) ).
> +.SH BUGS
> +In kernels before 2.6.37, a
> +.I timeout
> +value larger than approximately
> +.I LONG_MAX / HZ
> +milliseconds is treated as \-1 (i.e., infinity).
> +Thus, for example, on a system where
> +.I sizeof(long)
> +is 4 and the kernel
> +.I HZ
> +value is 1000,
> +this means that timeouts greater than 35.79 minutes are treated as infinity.
>  .SH SEE ALSO
>  .BR epoll_create (2),
>  .BR epoll_ctl (2),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes
  2021-05-09 21:39 ` [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
@ 2021-05-09 23:53   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:53 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Both POSIX and glibc use 'restrict' in
> pthread_attr_getinheritsched().
> Let's use it here too.
> 
> .../glibc$ grep_glibc_prototype pthread_attr_getinheritsched
> sysdeps/htl/pthread.h:90:
> extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict __attr,
> 					 int *__restrict __inheritsched)
> 	__THROW __nonnull ((1, 2));
> sysdeps/nptl/pthread.h:313:
> extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict
> 					 __attr, int *__restrict __inherit)
>      __THROW __nonnull ((1, 2));
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. Thanks!

Cheers,

Michael

> ---
>  man3/pthread_attr_setinheritsched.3 | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/man3/pthread_attr_setinheritsched.3 b/man3/pthread_attr_setinheritsched.3
> index 4ac1e3e7f..b834c1fd7 100644
> --- a/man3/pthread_attr_setinheritsched.3
> +++ b/man3/pthread_attr_setinheritsched.3
> @@ -33,8 +33,8 @@ inherit-scheduler attribute in thread attributes object
>  .PP
>  .BI "int pthread_attr_setinheritsched(pthread_attr_t *" attr ,
>  .BI "                                 int " inheritsched );
> -.BI "int pthread_attr_getinheritsched(const pthread_attr_t *" attr ,
> -.BI "                                 int *" inheritsched );
> +.BI "int pthread_attr_getinheritsched(const pthread_attr_t *restrict " attr ,
> +.BI "                                 int *restrict " inheritsched );
>  .PP
>  Compile and link with \fI\-pthread\fP.
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] pthread_attr_setschedparam.3: SYNOPSIS: Use 'restrict' in prototypes
  2021-05-09 21:39 ` [PATCH] pthread_attr_setschedparam.3: " Alejandro Colomar
@ 2021-05-09 23:53   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:53 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Both POSIX and glibc use 'restrict' in
> pthread_attr_getschedparam(), pthread_attr_setschedparam().
> Let's use it here too.
> 
> .../glibc$ grep_glibc_prototype pthread_attr_getschedparam
> sysdeps/htl/pthread.h:102:
> extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
> 				       struct sched_param *__restrict __param)
> 	__THROW __nonnull ((1, 2));
> sysdeps/nptl/pthread.h:294:
> extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr,
> 				       struct sched_param *__restrict __param)
>      __THROW __nonnull ((1, 2));
> .../glibc$ grep_glibc_prototype pthread_attr_setschedparam
> sysdeps/htl/pthread.h:107:
> extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
> 				       const struct sched_param *__restrict
> 				       __param) __THROW __nonnull ((1, 2));
> sysdeps/nptl/pthread.h:299:
> extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
> 				       const struct sched_param *__restrict
> 				       __param) __THROW __nonnull ((1, 2));
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Applied. Thanks!

Cheers,

Michael

> ---
>  man3/pthread_attr_setschedparam.3 | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/man3/pthread_attr_setschedparam.3 b/man3/pthread_attr_setschedparam.3
> index adc3fbcb2..72ee0143a 100644
> --- a/man3/pthread_attr_setschedparam.3
> +++ b/man3/pthread_attr_setschedparam.3
> @@ -31,10 +31,10 @@ scheduling parameter attributes in thread attributes object
>  .nf
>  .B #include <pthread.h>
>  .PP
> -.BI "int pthread_attr_setschedparam(pthread_attr_t *" attr ,
> -.BI "                               const struct sched_param *" param );
> -.BI "int pthread_attr_getschedparam(const pthread_attr_t *" attr ,
> -.BI "                               struct sched_param *" param );
> +.BI "int pthread_attr_setschedparam(pthread_attr_t *restrict " attr ,
> +.BI "                              const struct sched_param *restrict " param );
> +.BI "int pthread_attr_getschedparam(const pthread_attr_t *restrict " attr ,
> +.BI "                              struct sched_param *restrict " param );
>  .PP
>  Compile and link with \fI\-pthread\fP.
>  .fi
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] bswap.3: bswap_*() are implemented using functions
  2021-05-09 21:39 ` [PATCH] bswap.3: bswap_*() are implemented using functions Alejandro Colomar
@ 2021-05-09 23:55   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:55 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> See <bits/byteswap.h> in glibc.
> These macros call functions of the form __bswap_N(),
> which use uintN_t.
> 
> Eventhough it's true that they are macros,
> it's transparent to the user.
> 
> The user will see their results casted to unsigned types
> after the conversion do to the underlying functions,

^do^due

> so it's better to document these as the underlying functions,
> specifying the types.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>


Applied. Thanks! (Typo in commit message fixed.)

Cheers,

Michael


> ---
>  man3/bswap.3 | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/man3/bswap.3 b/man3/bswap.3
> index 937ef0416..369daa411 100644
> --- a/man3/bswap.3
> +++ b/man3/bswap.3
> @@ -29,19 +29,19 @@ bswap_16, bswap_32, bswap_64 \- reverse order of bytes
>  .nf
>  .B #include <byteswap.h>
>  .PP
> -.BI bswap_16( x );
> -.BI bswap_32( x );
> -.BI bswap_64( x );
> +.BI "uint16_t bswap_16(uint16_t " x );
> +.BI "uint32_t bswap_32(uint32_t " x );
> +.BI "uint64_t bswap_64(uint64_t " x );
>  .fi
>  .SH DESCRIPTION
> -These macros return a value in which the order of the bytes
> +These functions return a value in which the order of the bytes
>  in their 2-, 4-, or 8-byte arguments is reversed.
>  .SH RETURN VALUE
> -These macros return the value of their argument with the bytes reversed.
> +These functions return the value of their argument with the bytes reversed.
>  .SH ERRORS
> -These macros always succeed.
> +These functions always succeed.
>  .SH CONFORMING TO
> -These macros are GNU extensions.
> +These functions are GNU extensions.
>  .SH EXAMPLES
>  The program below swaps the bytes of the 8-byte integer supplied as
>  its command-line argument.
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] basename.3: SYNOPSIS: Add missing 'const'
  2021-05-09 21:38 ` [PATCH] basename.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
@ 2021-05-09 23:59   ` Michael Kerrisk (man-pages)
  2021-05-11  7:34     ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-09 23:59 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:38 AM, Alejandro Colomar wrote:
> Glibc uses 'const' for the basename() parameter.
> Fix the prototype.

Yes, but see basename(3p):

    SYNOPSIS
       #include <libgen.h>

       char *basename(char *path);

       ...

       The basename() function may modify the string pointed to by  path,
       and may return a pointer to internal storage. The returned pointer
       might be invalidated or the storage might be overwritten by a sub‐
       sequent  call  to  basename().  The returned pointer might also be
       invalidated if the calling thread is terminated.

I'll skip this patch.

Thanks,

Michael

> ......
> 
> .../glibc$ grep_glibc_prototype basename
> string/string.h:511:
> extern char *basename (const char *__filename) __THROW __nonnull ((1));
> .../glibc$
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man3/basename.3 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man3/basename.3 b/man3/basename.3
> index 65a14e8cb..51825eca4 100644
> --- a/man3/basename.3
> +++ b/man3/basename.3
> @@ -32,7 +32,7 @@ basename, dirname \- parse pathname components
>  .B #include <libgen.h>
>  .PP
>  .BI "char *dirname(char *" path );
> -.BI "char *basename(char *" path );
> +.BI "char *basename(const char *" path );
>  .fi
>  .SH DESCRIPTION
>  Warning: there are two different functions
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12
  2021-05-09 21:39 ` [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12 Alejandro Colomar
@ 2021-05-10  0:01   ` Michael Kerrisk (man-pages)
  2021-05-10  4:26     ` Amir Goldstein
  0 siblings, 1 reply; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10  0:01 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: mtk.manpages, linux-man, Luis Henriques, Amir Goldstein, Greg KH,
	Anna Schumaker, Jeff Layton, Steve French, Miklos Szeredi,
	Trond Myklebust, Alexander Viro, Darrick J. Wong, Dave Chinner,
	Nicolas Boichat, Ian Lance Taylor, Luis Lozano, Andreas Dilger,
	Olga Kornievskaia, Christoph Hellwig, ceph-devel, linux-kernel,
	CIFS, samba-technical, linux-fsdevel, Linux NFS Mailing List,
	Walter Harms

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Linux 5.12 fixes a regression.
> 
> Cross-filesystem (introduced in 5.3) copies were buggy.
> 
> Move the statements documenting cross-fs to BUGS.
> Kernels 5.3..5.11 should be patched soon.
> 
> State version information for some errors related to this.

Thanks. Patch applied.

Cheers,

Michael

> 
> Reported-by: Luis Henriques <lhenriques@suse.de>
> Reported-by: Amir Goldstein <amir73il@gmail.com>
> Related: <https://lwn.net/Articles/846403/>
> Cc: Greg KH <gregkh@linuxfoundation.org>
> Cc: Michael Kerrisk <mtk.manpages@gmail.com>
> Cc: Anna Schumaker <anna.schumaker@netapp.com>
> Cc: Jeff Layton <jlayton@kernel.org>
> Cc: Steve French <sfrench@samba.org>
> Cc: Miklos Szeredi <miklos@szeredi.hu>
> Cc: Trond Myklebust <trond.myklebust@hammerspace.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
> Cc: Dave Chinner <dchinner@redhat.com>
> Cc: Nicolas Boichat <drinkcat@chromium.org>
> Cc: Ian Lance Taylor <iant@google.com>
> Cc: Luis Lozano <llozano@chromium.org>
> Cc: Andreas Dilger <adilger@dilger.ca>
> Cc: Olga Kornievskaia <aglo@umich.edu>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: ceph-devel <ceph-devel@vger.kernel.org>
> Cc: linux-kernel <linux-kernel@vger.kernel.org>
> Cc: CIFS <linux-cifs@vger.kernel.org>
> Cc: samba-technical <samba-technical@lists.samba.org>
> Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
> Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
> Cc: Walter Harms <wharms@bfs.de>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/copy_file_range.2 | 27 +++++++++++++++++++++++----
>  1 file changed, 23 insertions(+), 4 deletions(-)
> 
> diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2
> index 467a16300..843e02241 100644
> --- a/man2/copy_file_range.2
> +++ b/man2/copy_file_range.2
> @@ -169,6 +169,9 @@ Out of memory.
>  .B ENOSPC
>  There is not enough space on the target filesystem to complete the copy.
>  .TP
> +.BR EOPNOTSUPP " (since Linux 5.12)"
> +The filesystem does not support this operation.
> +.TP
>  .B EOVERFLOW
>  The requested source or destination range is too large to represent in the
>  specified data types.
> @@ -184,10 +187,17 @@ or
>  .I fd_out
>  refers to an active swap file.
>  .TP
> -.B EXDEV
> +.BR EXDEV " (before Linux 5.3)"
> +The files referred to by
> +.IR fd_in " and " fd_out
> +are not on the same filesystem.
> +.TP
> +.BR EXDEV " (since Linux 5.12)"
>  The files referred to by
>  .IR fd_in " and " fd_out
> -are not on the same mounted filesystem (pre Linux 5.3).
> +are not on the same filesystem,
> +and the source and target filesystems are not of the same type,
> +or do not support cross-filesystem copy.
>  .SH VERSIONS
>  The
>  .BR copy_file_range ()
> @@ -200,8 +210,11 @@ Areas of the API that weren't clearly defined were clarified and the API bounds
>  are much more strictly checked than on earlier kernels.
>  Applications should target the behaviour and requirements of 5.3 kernels.
>  .PP
> -First support for cross-filesystem copies was introduced in Linux 5.3.
> -Older kernels will return -EXDEV when cross-filesystem copies are attempted.
> +Since Linux 5.12,
> +cross-filesystem copies can be achieved
> +when both filesystems are of the same type,
> +and that filesystem implements support for it.
> +See BUGS for behavior prior to 5.12.
>  .SH CONFORMING TO
>  The
>  .BR copy_file_range ()
> @@ -226,6 +239,12 @@ gives filesystems an opportunity to implement "copy acceleration" techniques,
>  such as the use of reflinks (i.e., two or more inodes that share
>  pointers to the same copy-on-write disk blocks)
>  or server-side-copy (in the case of NFS).
> +.SH BUGS
> +In Linux kernels 5.3 to 5.11,
> +cross-filesystem copies were implemented by the kernel,
> +if the operation was not supported by individual filesystems.
> +However, on some virtual filesystems,
> +the call failed to copy, while still reporting success.
>  .SH EXAMPLES
>  .EX
>  #define _GNU_SOURCE
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] open.2: Fix bug in linkat(2) call example
  2021-05-09 21:39 ` [PATCH] open.2: Fix bug in linkat(2) call example Alejandro Colomar
@ 2021-05-10  0:50   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10  0:50 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: mtk.manpages, linux-man, Walter Harms, Theodore Ts'o, Adam Borowski

Hi ALex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> AT_EMPTY_PATH works with empty strings (""), but not with NULL
> (or at least it's not obvious).
> 
> The relevant kernel code is the following:
> 
> linux$ sed -n 189,198p fs/namei.c
> 	result->refcnt = 1;
> 	/* The empty path is special. */
> 	if (unlikely(!len)) {
> 		if (empty)
> 			*empty = 1;
> 		if (!(flags & LOOKUP_EMPTY)) {
> 			putname(result);
> 			return ERR_PTR(-ENOENT);
> 		}
> 	}
> 
> Reported-by: Walter Harms <wharms@bfs.de>
> Cc: Theodore Ts'o <tytso@mit.edu>
> Cc: Adam Borowski <kilobyte@angband.pl>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

Cheers,

Michael

> ---
>  man2/open.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/open.2 b/man2/open.2
> index 6360636af..bac1ee806 100644
> --- a/man2/open.2
> +++ b/man2/open.2
> @@ -824,7 +824,7 @@ fd = open("/path/to/dir", O_TMPFILE | O_RDWR,
>  
>  /* File I/O on \(aqfd\(aq... */
>  
> -linkat(fd, NULL, AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
> +linkat(fd, "", AT_FDCWD, "/path/for/file", AT_EMPTY_PATH);
>  
>  /* If the caller doesn\(aqt have the CAP_DAC_READ_SEARCH
>     capability (needed to use AT_EMPTY_PATH with linkat(2)),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] .gitignore: Add file
  2021-05-09 21:39 ` [PATCH] .gitignore: Add file Alejandro Colomar
@ 2021-05-10  1:02   ` Michael Kerrisk (man-pages)
  2021-05-10  7:15     ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10  1:02 UTC (permalink / raw)
  To: Alejandro Colomar
  Cc: mtk.manpages, linux-man, Debian man-pages, Dr . Tobias Quathamer

Hi Alex,

On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> Ignore everything new by default.
> 
> This avoids having to update the .gitignore when we need to ignore
> something new.  It also avoids accidents that may add an unwanted
> temporary file.
> 
> Cc: Debian man-pages <manpages@packages.debian.org>
> Cc: Dr. Tobias Quathamer <toddy@debian.org>
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  .gitignore | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>  create mode 100644 .gitignore
> 
> diff --git a/.gitignore b/.gitignore
> new file mode 100644
> index 000000000..9eb9fc096
> --- /dev/null
> +++ b/.gitignore
> @@ -0,0 +1,13 @@
> +# Ignore everything new by default
> +/*
> +
> +# Ignore everything in man?/ that doesn't follow conventions (e.g., tmp files)
> +!/man?/
> +/man?/**
> +!/man?/**.?

Why '**'? Is '*' not sufficient in both of the above?

Thanks,

Michael

> +
> +# These files change name in each release
> +!/man-pages*.Announce
> +!/man-pages*.lsm
> +
> +!/scripts/
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] fflush.3: SEE ALSO: Add fpurge(3)
  2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
                   ` (33 preceding siblings ...)
  2021-05-09 21:39 ` [PATCH] Makefile: Simplify error handling Alejandro Colomar
@ 2021-05-10  1:03 ` Michael Kerrisk (man-pages)
       [not found] ` <20210509213930.94120-33-alx.manpages@gmail.com>
  35 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10  1:03 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 9:38 AM, Alejandro Colomar wrote:
> fpurge(i_stream) does the same as fflush(i_stream), AFAIK.
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

Thanks. Patch applied.

> ---
> 
> Hi Michael,
> 
> This is the first of many separate patches that I had pending for you.
> Some of them I already sent you, and you should ignore the old versions.
> Some of them are new.
> Please review them thoroughly, as I may have sent some patch that wasn't
> ready.  In theory I have reviewed them enough, but there are a lot, and
> I might have overlooked something.

Some I looked at more closely. Others (e.g., patches to the scripts),
I've taken on trust.

> When you review this "set", I'll send you another one about the SYNOPSIS.

Okay.

Cheers,

Michael


>  man3/fflush.3 | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/man3/fflush.3 b/man3/fflush.3
> index 138c9bcfe..a600da2ae 100644
> --- a/man3/fflush.3
> +++ b/man3/fflush.3
> @@ -133,6 +133,7 @@ or
>  .BR sync (2),
>  .BR write (2),
>  .BR fclose (3),
> +.BR fpurge (3),
>  .BR fileno (3),
>  .BR fopen (3),
>  .BR setbuf (3),
> 


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12
  2021-05-10  0:01   ` Michael Kerrisk (man-pages)
@ 2021-05-10  4:26     ` Amir Goldstein
  2021-05-10 16:34       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Amir Goldstein @ 2021-05-10  4:26 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Alejandro Colomar, linux-man, Luis Henriques, Greg KH,
	Anna Schumaker, Jeff Layton, Steve French, Miklos Szeredi,
	Trond Myklebust, Alexander Viro, Darrick J. Wong, Dave Chinner,
	Nicolas Boichat, Ian Lance Taylor, Luis Lozano, Andreas Dilger,
	Olga Kornievskaia, Christoph Hellwig, ceph-devel, linux-kernel,
	CIFS, samba-technical, linux-fsdevel, Linux NFS Mailing List,
	Walter Harms

On Mon, May 10, 2021 at 3:01 AM Michael Kerrisk (man-pages)
<mtk.manpages@gmail.com> wrote:
>
> Hi Alex,
>
> On 5/10/21 9:39 AM, Alejandro Colomar wrote:
> > Linux 5.12 fixes a regression.

Nope.
That never happened:
https://lore.kernel.org/linux-fsdevel/8735v4tcye.fsf@suse.de/

> >
> > Cross-filesystem (introduced in 5.3) copies were buggy.
> >
> > Move the statements documenting cross-fs to BUGS.
> > Kernels 5.3..5.11 should be patched soon.
> >
> > State version information for some errors related to this.
>
> Thanks. Patch applied.

I guess that would need to be reverted...

Thanks,
Amir.

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] Makefile: Simplify error handling
  2021-05-09 23:45   ` Michael Kerrisk (man-pages)
@ 2021-05-10  6:53     ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-05-10  6:53 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man, Dr. Tobias Quathamer, Matthias Klose, Andrej Shadura

[CC += Tobias, Mathias, Andrej]

Hi Michael,

On 5/10/21 1:45 AM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 5/10/21 9:39 AM, Alejandro Colomar wrote:
>> Instead of having to write '|| exit $$?' all the time,
>> use the shell's '-Eeuo pipefail' options, which handle
>> errors even better.  However, pipefail needs bash,
>> so POSIX sh (default) is not valid.
>>
>> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
>> ---
>>
>> Hi Michael,
>>
>> I'm not sure how much POSIX sh compatibility is needed for the man pages
>> Makefile.  There are probably projects out there that don't have bash,
>> and still want to use it.  So maybe we should't apply this.  I don't know.
>> Up to you.
> 
> I think I'll skip this one. I'm not sure if it might cause some
> problem for Debian, where the default shall is dash(1), I believe.

Debian has dash(1) as the default _non-interactive_ shell, but also has 
bash(1) as the default _interactive_ shell.  See 
<https://wiki.debian.org/Shell>.

I can confirm that using Debian (sid) myself (and having not installed 
bash(1) myself) I'm using this Makefile without any issue.

However, it's true that other smaller distros might not come with bash(1).

So still up to you :)

I forgot to CC the Debian maintainer of manpages in this patch this 
time; fixed.  I also CCed the bash(1) and dash(1) Debian maintainers, 
just in case they have any comments.

Thanks,

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] Makefile: Use standard features (IMPORTANT: default prefix changed)
       [not found]   ` <9f4a8c0c-ced3-4192-05a0-d126afda3285@gmail.com>
@ 2021-05-10  7:13     ` Alejandro Colomar (man-pages)
  2021-05-10 16:33       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-05-10  7:13 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

Hi Michael,

On 5/10/21 1:39 AM, Michael Kerrisk (man-pages) wrote:
>> - Specify shebang
> 
> Why? It's not quite obvious to me, and the commit message
> should really explain...

Hmmm.  I have some minor reasons to add it, but not a really good one.

* Some editors don't recognize 'Makefile' as a special name, so the 
shebang helps detecting which language the file is using (e.g., for 
coloring).

* I tend to subdivide a big Makefile into a small Makefile and many 
submakefiles stored in <./libexec/>.  Those obviously need different 
names, and given that the makefile extension is not very standard (I use 
.mk), having a shebang helps knowing what the file is.  After that, I 
also have it on the main Makefile for consistency.   But here we only 
have one Makefile, so it doesn apply very much.

And some similar reasons.


Thanks,

Alex

-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] .gitignore: Add file
  2021-05-10  1:02   ` Michael Kerrisk (man-pages)
@ 2021-05-10  7:15     ` Alejandro Colomar (man-pages)
  2021-05-10 16:28       ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-05-10  7:15 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: linux-man, Debian man-pages, Dr . Tobias Quathamer

Hi Michael,

On 5/10/21 3:02 AM, Michael Kerrisk (man-pages) wrote:
>> diff --git a/.gitignore b/.gitignore
>> new file mode 100644
>> index 000000000..9eb9fc096
>> --- /dev/null
>> +++ b/.gitignore
>> @@ -0,0 +1,13 @@
>> +# Ignore everything new by default
>> +/*
>> +
>> +# Ignore everything in man?/ that doesn't follow conventions (e.g., tmp files)
>> +!/man?/
>> +/man?/**
>> +!/man?/**.?
> 
> Why '**'? Is '*' not sufficient in both of the above?

You're right.  '*' is sufficient.  Please fix it yourself :)

Thanks,

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] .gitignore: Add file
  2021-05-10  7:15     ` Alejandro Colomar (man-pages)
@ 2021-05-10 16:28       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10 16:28 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages)
  Cc: mtk.manpages, linux-man, Debian man-pages, Dr . Tobias Quathamer

On 5/10/21 7:15 PM, Alejandro Colomar (man-pages) wrote:
> Hi Michael,
> 
> On 5/10/21 3:02 AM, Michael Kerrisk (man-pages) wrote:
>>> diff --git a/.gitignore b/.gitignore
>>> new file mode 100644
>>> index 000000000..9eb9fc096
>>> --- /dev/null
>>> +++ b/.gitignore
>>> @@ -0,0 +1,13 @@
>>> +# Ignore everything new by default
>>> +/*
>>> +
>>> +# Ignore everything in man?/ that doesn't follow conventions (e.g., tmp files)
>>> +!/man?/
>>> +/man?/**
>>> +!/man?/**.?
>>
>> Why '**'? Is '*' not sufficient in both of the above?
> 
> You're right.  '*' is sufficient.  Please fix it yourself :)

Okay -- patch applied, and I've tweaked.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] Makefile: Use standard features (IMPORTANT: default prefix changed)
  2021-05-10  7:13     ` [PATCH] Makefile: Use standard features (IMPORTANT: default prefix changed) Alejandro Colomar (man-pages)
@ 2021-05-10 16:33       ` Michael Kerrisk (man-pages)
  2021-05-10 16:41         ` Alejandro Colomar (man-pages)
  0 siblings, 1 reply; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10 16:33 UTC (permalink / raw)
  To: Alejandro Colomar (man-pages); +Cc: mtk.manpages, linux-man

Hi Alex,

On 5/10/21 7:13 PM, Alejandro Colomar (man-pages) wrote:
> Hi Michael,
> 
> On 5/10/21 1:39 AM, Michael Kerrisk (man-pages) wrote:
>>> - Specify shebang
>>
>> Why? It's not quite obvious to me, and the commit message
>> should really explain...
> 
> Hmmm.  I have some minor reasons to add it, but not a really good one.
> 
> * Some editors don't recognize 'Makefile' as a special name, so the 
> shebang helps detecting which language the file is using (e.g., for 
> coloring).
> 
> * I tend to subdivide a big Makefile into a small Makefile and many 
> submakefiles stored in <./libexec/>.  Those obviously need different 
> names, and given that the makefile extension is not very standard (I use 
> .mk), having a shebang helps knowing what the file is.  After that, I 
> also have it on the main Makefile for consistency.   But here we only 
> have one Makefile, so it doesn apply very much.

I think I'll remove it. It is kind of idiosyncratic, leaves the
reader asking "why?".

Thanks,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12
  2021-05-10  4:26     ` Amir Goldstein
@ 2021-05-10 16:34       ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-05-10 16:34 UTC (permalink / raw)
  To: Amir Goldstein
  Cc: mtk.manpages, Alejandro Colomar, linux-man, Luis Henriques,
	Greg KH, Anna Schumaker, Jeff Layton, Steve French,
	Miklos Szeredi, Trond Myklebust, Alexander Viro, Darrick J. Wong,
	Dave Chinner, Nicolas Boichat, Ian Lance Taylor, Luis Lozano,
	Andreas Dilger, Olga Kornievskaia, Christoph Hellwig, ceph-devel,
	linux-kernel, CIFS, samba-technical, linux-fsdevel,
	Linux NFS Mailing List, Walter Harms

Hi Amir,

On 5/10/21 4:26 PM, Amir Goldstein wrote:
> On Mon, May 10, 2021 at 3:01 AM Michael Kerrisk (man-pages)
> <mtk.manpages@gmail.com> wrote:
>>
>> Hi Alex,
>>
>> On 5/10/21 9:39 AM, Alejandro Colomar wrote:
>>> Linux 5.12 fixes a regression.
> 
> Nope.
> That never happened:
> https://lore.kernel.org/linux-fsdevel/8735v4tcye.fsf@suse.de/
> 
>>>
>>> Cross-filesystem (introduced in 5.3) copies were buggy.
>>>
>>> Move the statements documenting cross-fs to BUGS.
>>> Kernels 5.3..5.11 should be patched soon.
>>>
>>> State version information for some errors related to this.
>>
>> Thanks. Patch applied.
> 
> I guess that would need to be reverted...

Thanks for catching that. I had not pushed the patch, so 
I'll just drop it.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] Makefile: Use standard features (IMPORTANT: default prefix changed)
  2021-05-10 16:33       ` Michael Kerrisk (man-pages)
@ 2021-05-10 16:41         ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-05-10 16:41 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

On 5/10/21 6:33 PM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 5/10/21 7:13 PM, Alejandro Colomar (man-pages) wrote:
>> Hi Michael,
>>
>> On 5/10/21 1:39 AM, Michael Kerrisk (man-pages) wrote:
>>>> - Specify shebang
>>>
>>> Why? It's not quite obvious to me, and the commit message
>>> should really explain...
[...]
> I think I'll remove it. It is kind of idiosyncratic, leaves the
> reader asking "why?".

Agreed.

Cheers,

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 79+ messages in thread

* Re: [PATCH] basename.3: SYNOPSIS: Add missing 'const'
  2021-05-09 23:59   ` Michael Kerrisk (man-pages)
@ 2021-05-11  7:34     ` Alejandro Colomar (man-pages)
  0 siblings, 0 replies; 79+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-05-11  7:34 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages); +Cc: linux-man

Hi Michael,

On 5/10/21 1:59 AM, Michael Kerrisk (man-pages) wrote:
> Hi Alex,
> 
> On 5/10/21 9:38 AM, Alejandro Colomar wrote:
>> Glibc uses 'const' for the basename() parameter.
>> Fix the prototype.
> 
> Yes, but see basename(3p):
> 
>      SYNOPSIS
>         #include <libgen.h>
> 
>         char *basename(char *path);
> 
>         ...
> 
>         The basename() function may modify the string pointed to by  path,
>         and may return a pointer to internal storage. The returned pointer
>         might be invalidated or the storage might be overwritten by a sub‐
>         sequent  call  to  basename().  The returned pointer might also be
>         invalidated if the calling thread is terminated.
> 
> I'll skip this patch.

It's POSIX that states that, so yes, I'll drop it.

Cheers,

Alex


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

^ permalink raw reply	[flat|nested] 79+ messages in thread

end of thread, other threads:[~2021-05-11  7:34 UTC | newest]

Thread overview: 79+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 21:38 [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Alejandro Colomar
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases, scripts/modified_pages.sh: Move scripts/modified_pages.sh to a function man_gitstaged() Alejandro Colomar
2021-05-09 23:27   ` Michael Kerrisk (man-pages)
2021-05-09 21:38 ` [PATCH] scripts/bash_aliases: man_gitstaged(): Script around a porcelain git command Alejandro Colomar
2021-05-09 23:31   ` Michael Kerrisk (man-pages)
2021-05-09 21:38 ` [PATCH] basename.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
2021-05-09 23:59   ` Michael Kerrisk (man-pages)
2021-05-11  7:34     ` Alejandro Colomar (man-pages)
2021-05-09 21:38 ` [PATCH] dladdr.3: " Alejandro Colomar
2021-05-09 23:20   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] open.2: Fix bug in linkat(2) call example Alejandro Colomar
2021-05-10  0:50   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] malloc_usable_size.3: ffix Alejandro Colomar
2021-05-09 23:10   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] getutmp.3: ffix Alejandro Colomar
2021-05-09 23:10   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] on_exit.3: ffix Alejandro Colomar
2021-05-09 23:11   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] perror.3: ffix Alejandro Colomar
2021-05-09 23:12   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12 Alejandro Colomar
2021-05-10  0:01   ` Michael Kerrisk (man-pages)
2021-05-10  4:26     ` Amir Goldstein
2021-05-10 16:34       ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] sched_get_priority_max.2, open_memstream.3: tfix Alejandro Colomar
2021-05-09 23:19   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] __ppc_get_timebase.3: ffix Alejandro Colomar
2021-05-09 23:14   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Make man_lsfunc() more robust; Add sed_rm_ccomments() Alejandro Colomar
2021-05-09 23:32   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Add man_lsvar(), similar to man_lsfunc() but lists variables Alejandro Colomar
2021-05-09 23:32   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_attr_setinheritsched.3: SYNOPSIS: Use 'restrict' in prototypes Alejandro Colomar
2021-05-09 23:53   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_attr_setschedparam.3: " Alejandro Colomar
2021-05-09 23:53   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] strsignal.3: ffix Alejandro Colomar
2021-05-09 23:14   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] strsignal.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
2021-05-09 23:16   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] rpc.3: SYNOPSIS: Fix prototypes (misc.) Alejandro Colomar
2021-05-09 23:50   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_getattr_default_np.3: SYNOPSIS: Add missing 'const' Alejandro Colomar
2021-05-09 23:19   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] pthread_mutexattr_setrobust.3: SYNOPSIS: Remove incorrect 'const' Alejandro Colomar
2021-05-09 23:18   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] tzset.3: ffix Alejandro Colomar
2021-05-09 23:16   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] xdr.3: SYNOPSIS: Fix prototype types Alejandro Colomar
2021-05-09 23:51   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: man_section(): Accept multiple sections Alejandro Colomar
2021-05-09 23:33   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: Fix error messages Alejandro Colomar
2021-05-09 23:33   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] epoll_wait.2: Move subsection to NOTES from BUGS Alejandro Colomar
2021-05-09 23:52   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] bswap.3: bswap_*() are implemented using functions Alejandro Colomar
2021-05-09 23:55   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] cpow.3: Use 'complex' after the type consistently Alejandro Colomar
2021-05-09 23:49   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] clone.2: tfix Alejandro Colomar
2021-05-09 23:17   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] scripts/bash_aliases: srcfix Alejandro Colomar
2021-05-09 23:34   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] Makefile: Fix bug when running in parallel Alejandro Colomar
2021-05-09 23:39   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] .gitignore: Add file Alejandro Colomar
2021-05-10  1:02   ` Michael Kerrisk (man-pages)
2021-05-10  7:15     ` Alejandro Colomar (man-pages)
2021-05-10 16:28       ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] system_data_types.7: tfix Alejandro Colomar
2021-05-09 23:46   ` Michael Kerrisk (man-pages)
2021-05-09 21:39 ` [PATCH] Makefile: Simplify error handling Alejandro Colomar
2021-05-09 23:45   ` Michael Kerrisk (man-pages)
2021-05-10  6:53     ` Alejandro Colomar (man-pages)
2021-05-10  1:03 ` [PATCH] fflush.3: SEE ALSO: Add fpurge(3) Michael Kerrisk (man-pages)
     [not found] ` <20210509213930.94120-33-alx.manpages@gmail.com>
     [not found]   ` <9f4a8c0c-ced3-4192-05a0-d126afda3285@gmail.com>
2021-05-10  7:13     ` [PATCH] Makefile: Use standard features (IMPORTANT: default prefix changed) Alejandro Colomar (man-pages)
2021-05-10 16:33       ` Michael Kerrisk (man-pages)
2021-05-10 16:41         ` Alejandro Colomar (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.