#include <errno.h> extern int sys_nerr;
This variable gives the number of error messages in sys_errlist
(see section sys_errlist).
not ANSI, not POSIX
if (errno < sys_nerr) printf("Error: %s\n", sys_errlist[errno]);
Go to the first, previous, next, last section, table of contents.