void perror(char *s);
char *strerror(int errnum);
extern int sys_nerr;
extern char *sys_errlist;
To simplify variant formatting of messages, the vector of message strings can also be obtained by using the strerror function; errno can be used as the argument to this function to get the message string, without a trailing newline.
Although not specified by ANSI C or POSIX, for compatibility, this implementation also permits directly retrieving the vector of message strings from sys_errlist. Sys_nerr is the number of messages provided for in the table; it should be checked because new error codes may be added to the system before they are added to the table. The use of the strerror function is preferred over this mechanism.
Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97