Documentation about Minix.
[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, Minix 3.1.8, HP-UX 11.23, IRIX 6.5, Solaris 9, mingw.
14 @item
15 glibc and Cygwin have an incompatible version of this function.  The
16 POSIX compliant code
17 @smallexample
18 char *s = (strerror_r (err, buf, buflen) == 0 ? buf : NULL);
19 @end smallexample
20 is essentially equivalent to this code using the glibc function:
21 @smallexample
22 char *s = strerror_r (err, buf, buflen);
23 @end smallexample
24 @item
25 This function clobbers the @code{strerror} buffer on some platforms:
26 Cygwin 1.7.9.
27 @item
28 This function is sometimes not declared in @code{<string.h>} on some platforms:
29 glibc 2.8, OSF/1 5.1.
30 @item
31 The third argument is of type @code{int} instead of @code{size_t} on some
32 platforms:
33 AIX 5.1, OSF/1 5.1.
34 @item
35 When this function fails, it returns -1 and sets @code{errno}, instead of
36 returning the error number, on some platforms:
37 glibc 2.12 with @code{-D_POSIX_C_SOURCE=200112L}, AIX 6.1, OSF/1 5.1.
38 @item
39 When this function fails, it corrupts @code{errno}, on some platforms:
40 Solaris 10.
41 @item
42 This function does not support the error values that are specified by POSIX
43 but not defined by the system, on some platforms:
44 OpenBSD 4.0, OSF/1 5.1, NonStop Kernel, Cygwin 1.5.x.
45 @item
46 This function reports failure for @code{strerror_r(0, buf, len)},
47 although POSIX requires this to succeed, on some platforms:
48 FreeBSD 8.2.
49 @item
50 This function produces a different string for @code{0} than
51 @code{strerror} on some platforms:
52 MacOS X 10.5.
53 @item
54 This function always fails when the third argument is less than 80 on some
55 platforms:
56 HP-UX 11.31.
57 @item
58 When the buffer is too small and the value is in range, this function
59 does not fail, but instead truncates the result and returns 0 on some
60 platforms:
61 AIX 6.1, OSF/1 5.1.
62 @item
63 When the value is not in range or the buffer is too small, this
64 function fails to leave a NUL-terminated string in the buffer on some
65 platforms:
66 glibc 2.13, FreeBSD 8.2, Solaris 10.
67 @item
68 When the value is out of range but the buffer is too small, this
69 function does not always return the longest possible string on some
70 platforms:
71 OpenBSD 4.7.
72 @end itemize
73
74 Portability problems not fixed by Gnulib:
75 @itemize
76 @end itemize