avoid some overlong lines from posix urls, etc.
[gnulib.git] / doc / posix-functions / ctime_r.texi
1 @node ctime_r
2 @section @code{ctime_r}
3 @findex ctime_r
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ctime_r.html}
6
7 Gnulib module: extensions
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function has an incompatible declaration on some platforms:
13 Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
14 @end itemize
15
16 Portability problems not fixed by Gnulib:
17 @itemize
18 @item
19 This function is missing on some platforms:
20 mingw.
21 @item
22 This function may put more than 26 bytes into the argument buffer if an
23 invalid year is passed.
24 @end itemize
25
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.
35
36 A more flexible function is @code{strftime}.  However, note that it is
37 locale dependent.