[Mailman-Developers] News->Mail gateways

John Viega viega@list.org
Thu, 4 Jun 1998 19:56:12 -0700


On Thu, Jun 04, 1998 at 04:43:01PM -0400, Michael McLay wrote:
> 
> There is also a link error when building the source code on
> SunOS using gcc version 2.7.2.  Here's the snippet that shows the
> error.

Okay, it took me a while to find a machine to use sunning sunOS 4 and
gcc 2.7.2 :)

> ld: Undefined symbol 
>    _strerror 

Yes, apparently strerror() is nowhere to be found on such a system.  I
have 2 functions that I just wrote up.  The first duplicates the
behavior that strerror gives on other systems.  The second saves the
large static buffer, and will do for our purposes.  Just drop your
pick into common.c, and it should then compile:


Version 1 (Compatible):

#define STACK_BUFSIZE 8192

extern char *sys_errlist[];

char* strerror(int errno)
{
  static char msg[STACK_BUFSIZE];

  strcpy(msg, sys_errlist[errno]);
  return msg;
}


Version 2 (Efficient):

extern char *sys_errlist[];

char* strerror(int errno)
{
  return sys_errlist[errno];
}