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