*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> strerror (3)              



NAME    [Toc]    [Back]

     strerror - get error message string

SYNOPSIS    [Toc]    [Back]

     #include <string.h>

     char *
     strerror(int errnum);

     strerror_r(int errnum, char *strerrbuf, size_t buflen);

DESCRIPTION    [Toc]    [Back]

     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_r() is a thread safe  version  of  strerror()  that
places the error
     message in the specified buffer strerrbuf.

RETURN VALUES    [Toc]    [Back]

     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.

ERRORS    [Toc]    [Back]

     strerror() and strerror_r() may fail if:

     [EINVAL]      errnum is not a valid error number.   The  returned error
                   string  will  consist of an error message that

     strerror_r() may fail if:

     [ERANGE]      The error message is larger then buflen  characters.  The
                   message will be truncated to fit.

SEE ALSO    [Toc]    [Back]

     intro(2), perror(3), setlocale(3)

STANDARDS    [Toc]    [Back]

     The strerror() function conforms to ANSI X3.159-1989 (``ANSI
C'').  The
     strerror_r()  function   conforms   to   IEEE   Std   1003.1

OpenBSD      3.6                           June      29,     1991
[ Back ]
 Similar pages
Name OS Title
pam_strerror HP-UX get PAM error message string
pam_strerror FreeBSD get PAM standard error message string
t_strerror HP-UX produce an error message string
rapi_strerror Tru64 Get a RAPI error message string
t_strerror Tru64 Produce an error message string
t_strerror IRIX produce an error message string
gai_strerror Tru64 Print an error message string based on a return code from the getaddrinfo or getnameinfo routine
gluErrorString Tru64 produce an error string from a GL or GLU error code
gluerrorstring IRIX produce an error string from a GL or GLU error code
pam_error FreeBSD display an error message
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service