This is strerror.c in view mode; [Download] [Up]
#include <stdio.h>
#define INT_DIGITS 19 /* enough for 64 bit integer */
extern int sys_nerr;
extern char *sys_errlist[];
char *strerror(n)
int n;
{
static char buf[sizeof("Error ") + 1 + INT_DIGITS];
if (n >= 0 && n < sys_nerr && sys_errlist[n] != 0)
return sys_errlist[n];
else {
sprintf(buf, "Error %d", n);
return buf;
}
}
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.