aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-02-03 22:52:06 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-02-06 21:38:53 +0100
commit1b213b4fa497220684c6e02b59c54bc9fdc34953 (patch)
treeb2091cb1be72e0176f6c8ef665cea008788ff069
parenteaaa85c17c86b874c289cc1b8d9a48b0245f93bb (diff)
downloadman-pages-1b213b4fa497220684c6e02b59c54bc9fdc34953.tar.gz
gettimeofday.2: Use restrict in prototypes
POSIX specifies that the parameters of gettimeofday() shall be 'restrict'. Glibc uses 'restrict' too. Let's use it here too. ...... .../glibc$ grep_syscall_wrapper gettimeofday time/sys/time.h:66: extern int gettimeofday (struct timeval *__restrict __tv, void *__restrict __tz) __THROW __nonnull ((1)); .../glibc$ function grep_syscall_wrapper() { if ! [ -v 1 ]; then >&2 echo "Usage: ${FUNCNAME[0]} <syscall>"; return ${EX_USAGE}; fi find * -type f \ |grep '\.h$' \ |sort -V \ |xargs pcregrep -Mn \ "(?s)^[^\s#][\w\s]+\s+\**${1}\s*\([\w\s()[\]*,]*?(...)?\)[\w\s()]*;" \ |sed -E 's/^[^:]+:[0-9]+:/&\n/'; } Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man2/gettimeofday.27
1 files changed, 4 insertions, 3 deletions
diff --git a/man2/gettimeofday.2 b/man2/gettimeofday.2
index 085b86ad05..7e2726ed9c 100644
--- a/man2/gettimeofday.2
+++ b/man2/gettimeofday.2
@@ -44,9 +44,10 @@ gettimeofday, settimeofday \- get / set time
.nf
.B #include <sys/time.h>
.PP
-.BI "int gettimeofday(struct timeval *" tv ", struct timezone *" tz );
-.BI "int settimeofday(const struct timeval *" tv \
-", const struct timezone *" tz );
+.BI "int gettimeofday(struct timeval *restrict " tv ,
+.BI " struct timezone *restrict " tz );
+.BI "int settimeofday(const struct timeval *" tv ,
+.BI " const struct timezone *" tz );
.fi
.PP
.RS -4