IPB
>  Man Pages > Unix > FreeBSD 6.2 > Section 3 > strerror man page

strerror man page

Section 3 - FreeBSD 6.2 Man Pages

Other operating system man pages available here


Advanced Search

Hopefully, this page is exactly what you are looking for, but if not, you can always find further assistance on Unix/Linux Forum!


STRERROR(3)            FreeBSD Library Functions Manual            STRERROR(3)


NAME

     perror, strerror, strerror_r, sys_errlist, sys_nerr -- system error mes-
     sages


LIBRARY

     Standard C Library (libc, -lc)


SYNOPSIS

     #include <stdio.h>

     void
     perror(const char *string);

     extern const char * const sys_errlist[];
     extern const int sys_nerr;

     #include <string.h>

     char *
     strerror(int errnum);

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


DESCRIPTION

     The strerror(), strerror_r() and perror() functions look up the error
     message string corresponding to an error number.

     The strerror() function accepts an error number argument errnum and
     returns a pointer to the corresponding message string.

     The strerror_r() function renders the same result into strerrbuf for a
     maximum of buflen characters and returns 0 upon success.

     The perror() function finds the error message corresponding to the cur-
     rent value of the global variable errno (intro(2)) and writes it, fol-
     lowed by a newline, to the standard error file descriptor.  If the argu-
     ment string is non-NULL and does not point to the null character, this
     string is prepended to the message string and separated from it by a
     colon and space (``: ''); otherwise, only the error message string is
     printed.

     If the error number is not recognized, these functions return an error
     message string containing ``Unknown error: '' followed by the error num-
     ber in decimal.  The strerror() and strerror_r() functions return EINVAL
     as a warning.  Error numbers recognized by this implementation fall in
     the range 0 < errnum < sys_nerr.

     If insufficient storage is provided in strerrbuf (as specified in buflen)
     to contain the error string, strerror_r() returns ERANGE and strerrbuf
     will contain an error message that has been truncated and NUL terminated
     to fit the length specified by buflen.

     The message strings can be accessed directly using the external array
     sys_errlist.  The external value sys_nerr contains a count of the mes-
     sages in sys_errlist.  The use of these variables is deprecated;
     strerror() or strerror_r() should be used instead.


SEE ALSO

     intro(2), psignal(3)


STANDARDS

     The perror() and strerror() functions conform to ISO/IEC 9899:1999
     (``ISO C99'').  The strerror_r() function conforms to IEEE Std
     1003.1-2001 (``POSIX.1'').


HISTORY

     The strerror() and perror() functions first appeared in 4.4BSD.  The
     strerror_r() function was implemented in FreeBSD 4.4 by Wes Peters
     <wes@FreeBSD.org>.


BUGS

     For unknown error numbers, the strerror() function will return its result
     in a static buffer which may be overwritten by subsequent calls.

     The return type for strerror() is missing a type-qualifier; it should
     actually be const char *.

     Programs that use the deprecated sys_errlist variable often fail to com-
     pile because they declare it inconsistently.

FreeBSD 6.2                    October 12, 2004                    FreeBSD 6.2


Man(1) output converted with man2html and wrapped by fishsponge

This page was generated on Fri Sep 21 07:57:03 BST 2007

Your favourite pages:

No pages logged yet.
Trying to save cookie...

Top 10 most popular pages:

svn man page (5400 hits)
(FreeBSD 6.2)

sqlite3 man page (5399 hits)
(openSUSE 10.2)

adv_cap_autoneg man page (4903 hits)
(Solaris 10 11_06)

CPAN man page (4638 hits)
(Suse Linux 10.1)

ssh man page (4358 hits)
(Suse Linux 10.1)

ssh-socks5-proxy-connect man page (3024 hits)
(Solaris 10 11_06)

netcat man page (2831 hits)
(Suse Linux 10.1)

signal man page (2740 hits)
(Suse Linux 10.1)

pprosetup man page (2531 hits)
(Solaris 10 11_06)

startproc man page (2526 hits)
(Suse Linux 10.1)

Useful Links

Go Back

Visitor Statistics


Valid XHTML 1.0 Transitional     Valid CSS!

Partners: Cambridge Plus :: Pyrenees Ski Holidays :: Microprocessor Circuit Design :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum