Seth Woolley's Man Viewer

strerror(3) - strerror, strerror_r, strerror, strerror_r - return string describing error code - man 3 strerror

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

STRERROR(3)                Linux Programmer's Manual               STRERROR(3)

       strerror, strerror_r - return string(3,n) describing error(8,n) code

       #include <string.h>

       char *strerror(int errnum);
       int strerror_r(int errnum, char *buf, size_t n);

       The  strerror()  function  returns  a  string(3,n) describing the error(8,n) code
       passed in(1,8) the argument errnum, possibly using the LC_MESSAGES  part  of
       the  current  locale(3,5,7)  to  select(2,7,2 select_tut) the appropriate language.  This string(3,n)
       must not be modified by the application, but may be modified by a  sub-
       sequent  call to perror(1,3)() or strerror().  No library function will mod-
       ify this string.

       The strerror_r() function is similar to strerror(), but is thread safe.
       It returns the string(3,n) in(1,8) the user-supplied buffer buf of length n.

       The  strerror()  function  returns  the  appropriate  error(8,n) description
       string(3,n), or an unknown error(8,n) message if(3,n) the error(8,n) code is unknown.   The
       value  of  errno  is not changed for a successful call, and is set(7,n,1 builtins) to a
       nonzero value upon error.  The strerror_r() function returns 0 on  suc-
       cess and -1 on failure, setting errno.

       EINVAL The value of errnum is not a valid error(8,n) number.

       ERANGE Insufficient  storage was supplied to contain the error(8,n) descrip-
              tion string.

       SVID 3, POSIX, BSD 4.3, ISO/IEC 9899:1990 (C89).
       strerror_r() with prototype as given above is specified by  SUSv3,  and
       was  in(1,8)  use  under Digital Unix and HP Unix. An incompatible function,
       with prototype

       char *strerror_r(int errnum, char *buf, size_t n);

       is a GNU extension used by glibc (since 2.0), and must be  regarded  as
       obsolete  in(1,8) view of SUSv3.  The GNU version(1,3,5) may, but need not, use the
       user-supplied buffer.  If it does, the result may be truncated in(1,8)  case
       the  supplied buffer is too small. The result is always NUL-terminated.

       errno(3), perror(1,3)(3), strsignal(3)

                                  2001-10-16                       STRERROR(3)

References for this manual (incoming links)