Subject: Re: sys_errlist definition
To: Curt Sampson <curt@portal.ca>
From: J.T. Conklin <jconklin@netcom.com>
List: current-users
Date: 07/02/1996 10:48:05
> Now that sys_errlist is defined in errno.h, and defined correctly,
> a lot of non-ANSI programs break slightly when compiled because
> they also define it as just extern char * (without the const).
> What's the easiest and simplist way to determine, in the general
> case, whether one is running on a system that already has this
> defined? I'm currently using a #ifdef __NetBSD__ around the code,
> but I'd rather send back more general patches to the authors if I
> can, since I'm fairly certain this change needs to be made for
> FreeBSD and the like as well.

There is no "good" way to determine if/how sys_errlist is declared.

When I have run into this problem in the past, I've tried to send
patches back to the maintainer that change the program(s) to use
strerror() instead of sys_errlist.  The sys_errlist/sys_nerr
declarations can be put in a strerror() function wraped with #ifndef
HAVE_STRERROR or some such, so it will never be compiled on NetBSD.

	--jtc