diff mbox series

[08/14] getline.3: SYNOPSIS: Use 'restrict' in prototypes

Message ID 20210228004817.122463-9-alx.manpages@gmail.com
State New
Headers show
Series man3: SYNOPSIS: Use 'restrict' in prototypes (batch 2) | expand

Commit Message

Alejandro Colomar Feb. 28, 2021, 12:48 a.m. UTC
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>
---
 man3/getline.3 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/man3/getline.3 b/man3/getline.3
index 25930dbf9..182a8ca85 100644
--- a/man3/getline.3
+++ b/man3/getline.3
@@ -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