mirror of https://github.com/mkerrisk/man-pages
scandir.3: SYNOPSIS: Use 'restrict' in prototypes
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> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
e137171d80
commit
2866f31e8b
|
@ -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 **));"
|
||||
|
|
Loading…
Reference in New Issue