aboutsummaryrefslogtreecommitdiffstats
path: root/man3/strerror.3
diff options
context:
space:
mode:
Diffstat (limited to 'man3/strerror.3')
-rw-r--r--man3/strerror.337
1 files changed, 23 insertions, 14 deletions
diff --git a/man3/strerror.3 b/man3/strerror.3
index 8186a4673c..8dd8edad46 100644
--- a/man3/strerror.3
+++ b/man3/strerror.3
@@ -34,7 +34,7 @@
.\" 2005-12-13, mtk, Substantial rewrite of strerror_r() description
.\" Addition of extra material on portability and standards.
.\"
-.TH STRERROR 3 2005-12-13 "" "Linux Programmer's Manual"
+.TH STRERROR 3 2007-07-26 "" "Linux Programmer's Manual"
.SH NAME
strerror, strerror_r \- return string describing error number
.SH SYNOPSIS
@@ -44,14 +44,18 @@ strerror, strerror_r \- return string describing error number
.BI "char *strerror(int " errnum );
.sp
.BI "char *strerror_r(int " errnum ", char *" buf ", size_t " buflen );
- /* GNU-specific strerror_r() */
+.fi
.sp
-.B #define _XOPEN_SOURCE 600
-.B #include <string.h>
+.in -4n
+Feature Test Macro Requirements for glibc (see
+.BR feature_test_macros (7)):
+.in
.sp
-.BI "int strerror_r(int " errnum ", char *" buf ", size_t " buflen );
- /* XSI-compliant strerror_r() */
-.fi
+The XSI-compliant version of
+.BR strerror_r ()
+is provided if:
+.br
+(_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !\ _GNU_SOURCE
.SH DESCRIPTION
The
.BR strerror ()
@@ -72,13 +76,19 @@ function is similar to
but is
thread safe.
This function is available in two versions:
-an XSI-compliant version specified in POSIX.1-2001,
+an XSI-compliant version specified in POSIX.1-2001
+(available since glibc 2.3.4),
and a GNU-specific version (available since glibc 2.0).
-If
-.B _XOPEN_SOURCE
-is defined with the value 600,
-then the XSI-compliant version is provided,
+The XSI-compliant version is provided with the feature test macros
+settings shown in the SYNOPSIS;
otherwise the GNU-specific version is provided.
+If no feature test macros are explicitly defined,
+then (since glibc 2.4)
+.BR _POSIX_SOURCE
+is defined by default with the value
+200112L, so that the XSI-compliant version of
+.BR strerror_r ()
+is provided by default.
The XSI-compliant
.BR strerror_r ()
@@ -161,5 +171,4 @@ if the error number is unknown.
.BR errno (3),
.BR error (3),
.BR perror (3),
-.BR strsignal (3),
-.BR feature_test_macros (7)
+.BR strsignal (3)