[PATCH 22/23] scandir.3: SYNOPSIS: Use 'restrict' in prototypes

Alejandro Colomar
2021-03-08T18:55:17Z

POSIX does NOT specify scandir() to use 'restrict'.
However, glibc uses 'restrict'.
Users might be surprised by this! Let's use it here too!

.../glibc$ grep_glibc_prototype scandir
dirent/dirent.h:255:
extern int scandir (const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (const struct dirent *),
int (*__cmp) (const struct dirent **,
const struct dirent **))
__nonnull ((1, 2));
.../glibc$

Cc: glibc <libc-alpha@sourceware.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man3/scandir.3 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man3/scandir.3 b/man3/scandir.3
index 83a5eea7d..262e125c1 100644
--- a/man3/scandir.3
+++ b/man3/scandir.3
@@ -67,7 +67,7 @@ a directory for matching entries
.nf
.B #include <dirent.h>
.PP
-.BI "int scandir(const char *" dirp ", struct dirent ***" namelist ,
+.BI "int scandir(const char *restrict " dirp ", struct dirent ***restrict " namelist ,
.BI " int (*" filter ")(const struct dirent *),"
.BI " int (*" compar ")(const struct dirent **,"
.BR " const struct dirent **));"
--
2.30.1