aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2021-02-24 15:42:58 +0100
committerMichael Kerrisk <mtk.manpages@gmail.com>2021-03-03 23:12:22 +0100
commit0300d62fc1b422d6a9571cfdfdd5eec2af0059b0 (patch)
tree2e2d1a179567fb4d3bb07a24105fd15d656867df
parentcd7ebdf9ae72ca45611cf6117f4e9fe21eb2b4b4 (diff)
downloadman-pages-0300d62fc1b422d6a9571cfdfdd5eec2af0059b0.tar.gz
ctime.3: SYNOPSIS: Use 'restrict' in prototypes
POSIX does NOT specify ctime_r() to use 'restrict'. However, glibc uses 'restrict'. Users might be surprised by this! Let's use it here too! ...... .../glibc$ grep_glibc_prototype ctime_r timezone/private.h:504: char *ctime_r(time_t const *, char *); timezone/private.h:712: char *ctime_r(time_t const *, char *); time/time.h:153: extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; .../glibc$ Cc: <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>
-rw-r--r--man3/ctime.38
1 files changed, 7 insertions, 1 deletions
diff --git a/man3/ctime.3 b/man3/ctime.3
index c5434c84f5..d95641444b 100644
--- a/man3/ctime.3
+++ b/man3/ctime.3
@@ -44,7 +44,7 @@ localtime_r \- transform date and time to broken-down time or ASCII
.BI "char *asctime_r(const struct tm *restrict " tm ", char *restrict " buf );
.PP
.BI "char *ctime(const time_t *" timep );
-.BI "char *ctime_r(const time_t *" timep ", char *" buf );
+.BI "char *ctime_r(const time_t *restrict " timep ", char *restrict " buf );
.PP
.BI "struct tm *gmtime(const time_t *" timep );
.BI "struct tm *gmtime_r(const time_t *restrict " timep ,
@@ -381,6 +381,12 @@ as obsolete,
recommending the use of
.BR strftime (3)
instead.
+.PP
+POSIX doesn't specify the parameters of
+.BR ctime_r ()
+to be
+.IR restrict ;
+that is specific to glibc.
.SH NOTES
The four functions
.BR asctime (),