From 8f5b718ea12c559b9eeaf646d014b969a380a551 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Sun, 14 Feb 2021 00:10:14 +0100 Subject: [PATCH] readlink.2: SYNOPSIS: Use 'restrict' in prototypes POSIX specifies that the parameters of readlink() and readlinkat() shall be 'restrict'. Glibc uses 'restrict' too. Let's use it here too. ...... .../glibc$ grep_glibc_prototype readlink posix/unistd.h:820: extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull ((1, 2)) __wur __attr_access ((__write_only__, 2, 3)); .../glibc$ grep_glibc_prototype readlinkat posix/unistd.h:832: extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) __THROW __nonnull ((2, 3)) __wur __attr_access ((__write_only__, 3, 4)); .../glibc$ Signed-off-by: Alejandro Colomar Signed-off-by: Michael Kerrisk --- man2/readlink.2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/man2/readlink.2 b/man2/readlink.2 index 88c07e66d..92b9b09ae 100644 --- a/man2/readlink.2 +++ b/man2/readlink.2 @@ -48,14 +48,14 @@ readlink, readlinkat \- read value of a symbolic link .nf .B #include .PP -.BI "ssize_t readlink(const char *" pathname ", char *" buf \ -", size_t " bufsiz ); +.BI "ssize_t readlink(const char *restrict " pathname ", char *restrict " buf , +.BI " size_t " bufsiz ); .PP .BR "#include " "/* Definition of AT_* constants */" .B #include .PP -.BI "ssize_t readlinkat(int " dirfd ", const char *" pathname , -.BI " char *" buf ", size_t " bufsiz ); +.BI "ssize_t readlinkat(int " dirfd ", const char *restrict " pathname , +.BI " char *restrict " buf ", size_t " bufsiz ); .PP .fi .RS -4