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>
This commit is contained in:
Alejandro Colomar 2021-02-24 15:42:58 +01:00 committed by Michael Kerrisk
parent cd7ebdf9ae
commit 0300d62fc1
1 changed files with 7 additions and 1 deletions

View File

@ -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 (),