New module 'strerror_r-posix'.
[gnulib.git] / doc / posix-functions / strerror_r.texi
1 @node strerror_r
2 @section @code{strerror_r}
3 @findex strerror_r
4
5 POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/strerror_r.html}
6
7 Gnulib module: strerror_r-posix
8
9 Portability problems fixed by Gnulib:
10 @itemize
11 @item
12 This function is missing on some platforms:
13 NetBSD 3.0, HP-UX 11.23, IRIX 6.5, Solaris 9, mingw.
14 @item
15 glibc has an incompatible version of this function.  The POSIX compliant code
16 @smallexample
17 char *s = (strerror_r (err, buf, buflen) == 0 ? buf : NULL);
18 @end smallexample
19 is essentially equivalent to this code using the glibc function:
20 @smallexample
21 char *s = strerror_r (err, buf, buflen);
22 @end smallexample
23 @item
24 This function is sometimes not declared in @code{<string.h>} on some platforms:
25 glibc 2.8, OSF/1 5.1.
26 @item
27 The third argument is of type @code{int} instead of @code{size_t} on some
28 platforms:
29 AIX 5.1, OSF/1 5.1.
30 @item
31 When this function fails, it returns -1 and sets @code{errno}, instead of
32 returning the error number, on some platforms:
33 glibc 2.8 with @code{-D_POSIX_C_SOURCE=200112L}, AIX 6.1, OSF/1 5.1.
34 @item
35 This function does not support the error values that are specified by POSIX
36 but not defined by the system, on some platforms:
37 OpenBSD 4.0, OSF/1 5.1, NonStop Kernel, Cygwin 1.5.x.
38 @item
39 This function always fails when the third argument is less than 80 on some
40 platforms:
41 HP-UX 11.31.
42 @item
43 When the buffer is too small, this function does not fail, but instead
44 truncates the result and returns 0 on some platforms:
45 OSF/1 5.1.
46 @end itemize
47
48 Portability problems not fixed by Gnulib:
49 @itemize
50 @item
51 When the buffer is too small, this function does not fail, but instead
52 truncates the result and returns 0 on some platforms:
53 AIX 6.1.
54 @end itemize