mirror of https://github.com/mkerrisk/man-pages
strerror.3: Correct description of error return for XSI strerror_r()
The XSI-compliant version of strerror_r() doesn't return -1 on error and set errno. Instead, a positive error number is returned. That's what POSIX says: Upon successful completion, strerror_r() shall return 0. Otherwise, an error number shall be returned to indicate the error. I tested with an invalid error number. While some implementations seem to write "Unknown error xxx" into the supplied buffer, some others don't and only return EINVAL. The latest glibc 2.14.1 from Arch Linux belongs to the first category while eglibc 2.13 from current Debian testing belongs to the second category. However, both implementation are correct according to POSIX. So I think the manpage was wrong and POSIX and the implementations are correct. Signed-off-by: Signed-off-by: Bernhard Walle <bernhard@bwalle.de> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
a146d9cccd
commit
a5fa6dfd19
|
@ -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 2009-03-30 "" "Linux Programmer's Manual"
|
||||
.TH STRERROR 3 2012-04-22 "" "Linux Programmer's Manual"
|
||||
.SH NAME
|
||||
strerror, strerror_r \- return string describing error number
|
||||
.SH SYNOPSIS
|
||||
|
@ -133,9 +133,7 @@ or an "Unknown error nnn" message if the error number is unknown.
|
|||
The XSI-compliant
|
||||
.BR strerror_r ()
|
||||
function returns 0 on success;
|
||||
on error, \-1 is returned and
|
||||
.I errno
|
||||
is set to indicate the error.
|
||||
on error, a (positive) error number is returned.
|
||||
.SH ERRORS
|
||||
.TP
|
||||
.B EINVAL
|
||||
|
|
Loading…
Reference in New Issue