MirOS Manual: strerror(3), strerror_r(3)

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


     strerror - get error message string


     #include <string.h>

     char *
     strerror(int errnum);

     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 charac-
     ters, including the trailing NUL. This string is not to be modified by
     the calling program, but may be overwritten by subsequent calls to strer-

     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 oc-
     curs, 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]      errnum is not a valid error number. The returned error
                   string will consist of an error message that includes

     strerror_r() may fail if:

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


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


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

MirOS BSD #10-current           June 29, 1991                                1

Generated on 2014-07-04 21:17:45 by $MirOS: src/scripts/roff2htm,v 1.79 2014/02/10 00:36:11 tg Exp $

These manual pages and other documentation are copyrighted by their respective writers; their source is available at our CVSweb, AnonCVS, and other mirrors. The rest is Copyright © 2002‒2014 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.