Initial import of the CDE 2.1.30 sources from the Open Group.
This commit is contained in:
37
cde/programs/dtdocbook/sgmls/strerror.c
Normal file
37
cde/programs/dtdocbook/sgmls/strerror.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/* $XConsortium: strerror.c /main/3 1996/06/19 17:18:42 drk $ */
|
||||
/* strerror.c -
|
||||
ANSI C strerror() function.
|
||||
|
||||
Written by James Clark (jjc@jclark.com).
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef STRERROR_MISSING
|
||||
#include <stdio.h>
|
||||
|
||||
char *strerror(n)
|
||||
int n;
|
||||
{
|
||||
extern int sys_nerr;
|
||||
extern char *sys_errlist[];
|
||||
static char buf[sizeof("Error ") + 1 + 3*sizeof(int)];
|
||||
|
||||
if (n >= 0 && n < sys_nerr && sys_errlist[n] != 0)
|
||||
return sys_errlist[n];
|
||||
else {
|
||||
sprintf(buf, "Error %d", n);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* STRERROR_MISSING */
|
||||
/*
|
||||
Local Variables:
|
||||
c-indent-level: 5
|
||||
c-continued-statement-offset: 5
|
||||
c-brace-offset: -5
|
||||
c-argdecl-indent: 0
|
||||
c-label-offset: -5
|
||||
End:
|
||||
*/
|
||||
Reference in New Issue
Block a user