From 32514265eae23c9196b09477c63ab26850ecbe6a Mon Sep 17 00:00:00 2001 From: tjg Date: Wed, 13 Oct 1999 15:37:34 +0000 Subject: Portability: use POSIX strerror() where it's available; fake it with sys_errlist[] where not. --- proto.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'proto.h') diff --git a/proto.h b/proto.h index 0f24fb5..7d2fe2a 100644 --- a/proto.h +++ b/proto.h @@ -59,6 +59,15 @@ extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); #endif /* STDC_HEADERS */ +#if HAVE_STRERROR +/* Smells like POSIX. */ +#else +/* Assume BSD-style sys_errlist[]. */ +extern int sys_nerr; +extern char *sys_errlist[]; +#define strerror(x) ((0 <= (x)) && (errno < (x)) ? sys_errlist[x] : (char *)0) +#endif + #if HAVE_UNISTD_H #include #endif -- cgit v1.2.3