2 @section @code{ctime_r}
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ctime_r.html}
7 Gnulib module: extensions
9 Portability problems fixed by Gnulib:
12 This function has an incompatible declaration on some platforms:
13 Solaris 11.4 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
16 Portability problems not fixed by Gnulib:
19 This function is missing on some platforms:
22 This function may put more than 26 bytes into the argument buffer if an
23 invalid year is passed.
26 @code{ctime_r} takes a pre-allocated buffer and length of the buffer,
27 and returns @code{NULL} on errors.
28 The input buffer should be at least 26 bytes in size. The output
29 string is locale-independent. However, years can have more than 4
30 digits if @code{time_t} is sufficiently wide, so the length of the
31 required output buffer is not easy to determine. Increasing the
32 buffer size when @code{ctime_r} returns @code{NULL} is not necessarily
33 sufficient. The @code{NULL} return value could mean some other error
34 condition, which will not go away by increasing the buffer size.
36 A more flexible function is @code{strftime}. However, note that it is