getline.3: SYNOPSIS: Use 'restrict' in prototypes

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

.../glibc$ grep_glibc_prototype getline
libio/stdio.h:621:
extern __ssize_t getline (char **__restrict __lineptr,
                          size_t *__restrict __n,
                          FILE *__restrict __stream) __wur;
.../glibc$ grep_glibc_prototype getdelim
libio/stdio.h:611:
extern __ssize_t getdelim (char **__restrict __lineptr,
                           size_t *__restrict __n, int __delimiter,
                           FILE *__restrict __stream) __wur;
.../glibc$

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2021-02-28 01:48:12 +01:00 committed by Michael Kerrisk
parent 938c8215eb
commit 22f4c26563
1 changed files with 4 additions and 3 deletions

View File

@ -30,9 +30,10 @@ getline, getdelim \- delimited string input
.nf
.B #include <stdio.h>
.PP
.BI "ssize_t getline(char **" lineptr ", size_t *" n ", FILE *" stream );
.BI "ssize_t getdelim(char **" lineptr ", size_t *" n ", int " delim \
", FILE *" stream );
.BI "ssize_t getline(char **restrict " lineptr ", size_t *restrict " n ,
.BI " FILE *restrict " stream );
.BI "ssize_t getdelim(char **restrict " lineptr ", size_t *restrict " n ,
.BI " int " delim ", FILE *restrict " stream );
.fi
.PP
.RS -4