strerror - get error message string
#include <string.h> char *strerror(int errnum);
The strerror() function maps the error number in errnum to a locale-dependent error message string and returns a pointer thereto. The string pointed to must not be modified by the program, but may be overwritten by a subsequent call to strerror() or perror().The contents of the error message strings returned by strerror() should be determined by the setting of the LC_MESSAGES category in the current locale.
The implementation will behave as if no function defined in this specification calls strerror().
The strerror() function will not change the setting of errno if successful.
Because no return value is reserved to indicate an error, an application wishing to check for error situations should set errno to 0, then call strerror(), then check errno.
This interface need not be reentrant.
Upon successful completion, strerror() returns a pointer to the generated message string. On error errno may be set, but no return value is reserved to indicate an error.
The strerror() function may fail if:
- [EINVAL]
- The value of errnum is not a valid error number.
None.
None.
None.
perror(), <string.h>.