Hash :
e7d12124
Author :
Date :
2023-04-19T20:07:52
doc: Add references to changes accepted for future POSIX revisions. * doc/glibc-functions/bind_textdomain_codeset.texi: Add reference to www.austingroupbugs.net issue. * doc/glibc-functions/bindtextdomain.texi: Likewise. * doc/glibc-functions/dcgettext.texi: Likewise. * doc/glibc-functions/dcngettext.texi: Likewise. * doc/glibc-functions/dgettext.texi: Likewise. * doc/glibc-functions/dngettext.texi: Likewise. * doc/glibc-functions/getentropy.texi: Likewise. * doc/glibc-functions/getresgid.texi: Likewise. * doc/glibc-functions/getresuid.texi: Likewise. * doc/glibc-functions/gettext.texi: Likewise. * doc/glibc-functions/ngettext.texi: Likewise. * doc/glibc-functions/posix_spawn_file_actions_addchdir_np.texi: Likewise. * doc/glibc-functions/posix_spawn_file_actions_addfchdir_np.texi: Likewise. * doc/glibc-functions/setresgid.texi: Likewise. * doc/glibc-functions/setresuid.texi: Likewise. * doc/glibc-functions/textdomain.texi: Likewise. * doc/posix-functions/asctime_r.texi: Likewise. * doc/posix-functions/ctime_r.texi: Likewise.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
@node ctime_r
@section @code{ctime_r}
@findex ctime_r
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime_r.html}
Future POSIX removal:@* @url{https://www.austingroupbugs.net/view.php?id=1410}
Gnulib module: extensions
Portability problems fixed by Gnulib:
@itemize
@item
This function has an incompatible declaration on some platforms:
Solaris 11.4 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
This function is missing on some platforms:
mingw, MSVC 14.
@item
This function may put more than 26 bytes into the argument buffer if an
invalid year is passed.
@end itemize
@code{ctime_r} takes a pre-allocated buffer and length of the buffer,
and returns @code{NULL} on errors.
The input buffer should be at least 26 bytes in size. The output
string is locale-independent. However, years can have more than 4
digits if @code{time_t} is sufficiently wide, so the length of the
required output buffer is not easy to determine. Increasing the
buffer size when @code{ctime_r} returns @code{NULL} is not necessarily
sufficient. The @code{NULL} return value could mean some other error
condition, which will not go away by increasing the buffer size.
A more flexible function is @code{strftime}. However, note that it is
locale dependent.