Subject: Continuing saga. :)

From: [email-masked]
Date: Mon, 29 Mar 1993 06:55:10 -0800

Well, folks, as those who've shown interest know (and there have been
exactly zero of them) I've got things compiling fine on my MIPS
platform, but I'm running into a little more trouble. There are two
library routines that the linker cannot find:

   strerror
   strftime

While strftime is on one of my local suns, strerror is kinda an enigma
to me. Anyone know what it's supposed to do so I can emulate it with
my own code?

Thanks, --JRP

---

From: [email-masked]
Date: Mon, 29 Mar 1993 11:14:49 -0800

|Well, folks, as those who've shown interest know (and there have been
|exactly zero of them) I've got things compiling fine on my MIPS
|platform, but I'm running into a little more trouble. There are two
|library routines that the linker cannot find:
|
|   strerror
|   strftime
|
|While strftime is on one of my local suns, strerror is kinda an enigma
|to me. Anyone know what it's supposed to do so I can emulate it with
|my own code?
|
|Thanks, --JRP

I've ecnountered 2 different forms of strerror(), one that takes an
argument and one that doesn't.  The one that takes 0 arguments checks
the external int variable errno.

If your OS supplies these variables:

	extern char *sys_errlist[];	/* text of errors */
	extern int sys_nerr;		/* length of array */

This function should work for you:

	char * strerror ( int error )
	{
	    static char	buf[16];

	    if (error > sys_nerr)
	    {
		sprintf(buf, "Error %d", error);
		return buf;
	    }

	    return sys_errlist[error];
	}

if your OS doesn't supply them, you can either define your own array
and length, or use this code:

char * strerror ( int error )
{
    static char	buf[16];
    
    sprintf(buf, "Error %d", error);
    return buf;
}

DavidM/NightWalker
-- 
DavidM			CATS - Commodore Applications and Technical Support
+1 215 431 9425		[email-masked]
"Commodore Amiga 3000UX - Born to Run UNIX SVR4"