STRERROR(3) | Library Functions Manual | STRERROR(3) |
strerror
,
strerror_r
— get error
message string
#include
<string.h>
char *
strerror
(int
errnum);
int
strerror_r
(int
errnum, char
*strerrbuf, size_t
buflen);
The
strerror
()
and strerror_r
() functions map the error number
errnum to a language-dependent error message
string.
strerror
()
returns a string containing a maximum of NL_TEXTMAX
characters, including the trailing NUL. This string is not to be modified by
the calling program, but may be overwritten by subsequent calls to
strerror
().
strerror_r
()
is a thread safe version of strerror
() that places
the error message in the specified buffer
strerrbuf.
strerror
() returns a pointer to the error
message string. If an error occurs, the error code is stored in
errno.
strerror_r
() returns zero upon successful
completion. If an error occurs, the error code is stored in
errno and the error code is returned.
strerror
() and
strerror_r
() may fail if:
EINVAL
]strerror_r
() may fail if:
ERANGE
]The strerror
() function conforms to. The
strerror_r
() function conforms to
IEEE Std 1003.1-2008 (“POSIX.1”).
The strerror
() function first appeared in
4.3BSD-Reno. The
strerror_r
() function first appeared in
OpenBSD 3.3.
April 7, 2014 | OpenBSD-5.6 |