Standard C Library Functions strerror(3C)
NAME
strerror, strerrorr - get error message string
SYNOPSIS
#include
char *strerror(int errnum);
int strerrorr(int errnum, char *strerrbuf, sizet buflen);
DESCRIPTION
The strerror() function maps the error number in errnum to
an error message string, and returns a pointer to that
string. It uses the same set of error messages as
perror(3C). The returned string should not be overwritten.
The strerrorr() function maps the error number in errnum to
anerror message string and returns the string in the buffer
pointed to by strerrbuf with length buflen.
RETURN VALUES
Upon successful completion, strerror() returns a pointer to
the generated message string. Otherwise, it sets errno and
returns a pointer to an error message string. It returns the
string "Unknown error" if errnum is not a valid error
number.
Upon successful completion, strerrorr() returns 0. Other-
wise it sets errno and returns the value of errno to indi-
cate the error. It returns the string "Unknown error" in the
buffer pointed to by strerrbuf if errnum is not a valid
error number.
ERORS
These functions may fail if:
EINVAL The value of errnum is not a valid error number.
The strerrorr() function may fail if:
ERANGE The buflen argument specifies insufficient storage
to contain the generated message string.
USAGE
SunOS 5.11 Last change: 31 Mar 2005 1
Standard C Library Functions strerror(3C)
Messages returned from these functions are in the native
language specified by the LCMESAGES locale category. See
setlocale(3C).
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Standard
MT-Level Safe
SEE ALSO
gettext(3C), perror(3C), setlocale(3C), attributes(5), stan-
dards(5)
SunOS 5.11 Last change: 31 Mar 2005 2
|