annotate doc/posix-functions/ctime_r.texi @ 13267:d6ab91053834

Use the 'extensions' module for some more functions on Solaris.
author Bruno Haible <bruno@clisp.org>
date Sun, 25 Apr 2010 23:08:38 +0200
parents d12a380d8ac1
children bb0ceefd22dc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 @node ctime_r
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 @section @code{ctime_r}
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 @findex ctime_r
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4
10876
c83dc7e8df57 Refer to new POSIX:2008 standard.
Bruno Haible <bruno@clisp.org>
parents: 9638
diff changeset
5 POSIX specification: @url{http://www.opengroup.org/onlinepubs/9699919799/functions/ctime_r.html}
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
13267
d6ab91053834 Use the 'extensions' module for some more functions on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 13265
diff changeset
7 Gnulib module: extensions
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 Portability problems fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 @itemize
13267
d6ab91053834 Use the 'extensions' module for some more functions on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 13265
diff changeset
11 @item
d6ab91053834 Use the 'extensions' module for some more functions on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 13265
diff changeset
12 This function has an incompatible declaration on some platforms:
d6ab91053834 Use the 'extensions' module for some more functions on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 13265
diff changeset
13 Solaris 10 (when @code{_POSIX_PTHREAD_SEMANTICS} is not defined).
9638
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 Portability problems not fixed by Gnulib:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 @itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 @item
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 This function is missing on some platforms:
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 mingw.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 @item
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 This function may put more than 26 bytes into the argument buffer if an
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 invalid year is passed.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 @end itemize
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 @code{ctime_r} takes a pre-allocated buffer and length of the buffer,
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 and returns @code{NULL} on errors.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 The input buffer should be at least 26 bytes in size. The output
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 string is locale-independent. However, years can have more than 4
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 digits if @code{time_t} is sufficiently wide, so the length of the
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 required output buffer is not easy to determine. Increasing the
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 buffer size when @code{ctime_r} returns @code{NULL} is not necessarily
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 sufficient. The @code{NULL} return value could mean some other error
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 condition, which will not go away by increasing the buffer size.
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 A more flexible function is @code{strftime}. However, note that it is
070329237839 Rename two directories: headers -> posix-headers, functions -> posix-functions.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 locale dependent.