/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* return error message string given errno
*/
#include "lclib.h"
#if !defined(sys_errlist) && !_def_errno_sys_errlist
#if _dat_sys_errlist
extern char* sys_errlist[];
#else
char* sys_errlist[] = { 0 };
#endif
#endif
#if !defined(sys_nerr) && !_def_errno_sys_nerr
#if _dat_sys_nerr
extern int sys_nerr;
#else
int sys_nerr = 0;
#endif
#endif
#if _lib_strerror
extern char* strerror(int);
#endif
#if _PACKAGE_astsa
#endif
char*
{
char* msg;
int z;
#if _lib_strerror
z = errno;
errno = z;
#else
else
msg = 0;
#endif
if (msg)
{
#if !_PACKAGE_astsa
if (ERROR_translating())
{
#if _lib_strerror
static int sys;
if (!sys)
{
char* s;
char* t;
char* p;
#if _lib_strerror
/*
* stash the pending strerror() msg
*/
#endif
/*
* make sure that strerror() translates
*/
if (!(s = strerror(1)))
sys = -1;
else
{
strcpy(t, s);
setlocale(LC_MESSAGES, p);
}
}
if (sys > 0)
return msg;
#endif
}
#endif
return msg;
}
return msg;
}
#if !_lib_strerror
#if defined(__EXPORT__)
#define extern __EXPORT__
#endif
extern char*
{
return _ast_strerror(err);
}
#endif