COHERENT manpages

This page displays the COHERENT manpage for strerror() [Translate an error number into a string].

List of available manpages
Index


strerror() -- String Function (libc)

Translate an error number into a string
#include <string.h>
char *strerror(error)
int error;

strerror()  helps to  generate  an error  message.  It  takes the  argument
error, which presumably is an error code generated by an error condition in
a program, and may return a pointer to the corresponding error message.

The  error numbers  recognized  and the  texts of  the corresponding  error
messages are set by COHERENT.

See Also

libc,
perror(),
string.h
ANSI Standard, §7.11.6.2

Notes

strerror() returns a pointer to a static array that may be overwritten by a
subsequent call to strerror().

strerror()  differs from  the related  function  perror() in  the following
ways:  strerror() receives  the error  number  through its  argument error,
whereas perror() reads  the global constant errno. Also, strerror() returns
a  pointer  to  the error  message,  whereas  perror()  writes the  message
directly into the standard error stream.

The error numbers recognized and  the texts of the messages associated with
each error  number are set  by COHERENT.  However,  strerror() and perror()
return the same error message when handed the same error number.