shared memory
Mark Lawrence
mark at DRD.Com
Mon Sep 24 23:55:30 AEST 1990
} in article <1990Sep21.183326.13116 at DRD.Com>, mark at DRD.Com (Mark Lawrence) says:
} > extern const char *strerror(int);
gt0178a at prism.gatech.EDU (BURNS,JIM) wrote:
} I had more compile troubles w/this last line then any other in the program.
} I had to substitute:
}
} extern char *sys_errlist[];
The following thanks to Chris Torek:
/*
* >From: chris at mimsy.UUCP (Chris Torek)
*
* In article <349 at auspex.UUCP> guy at auspex.UUCP (Guy Harris) writes: *Grumble
* bitch* please use "sys_errlist[]" next time, thank you.... It might even
* make it easier to figure out what's wrong.
*
* Actually, use strerror(): This should be in your dpANS-conformant
* C library (what, you have no dpANS-conformant *compiler*? :-) )
*
*/
#include <ANSIPrototypes.h>
const char *strerror(int err)
{
extern const char *sys_errlist[];
extern const int sys_nerr;
static char expand[40];
if ((unsigned) err < sys_nerr)
return (sys_errlist[err]);
(void) sprintf(expand, "unknown error code %d", err);
return (expand);
}
--
mark at DRD.Com uunet!apctrc!drd!mark$B!J%^!<%/!!!&%m!<%l%s%9!K(B
More information about the Comp.lang.c
mailing list