Add minimal strsignal for platforms without it.

This commit is contained in:
Darren Tucker 2017-09-25 09:48:10 +10:00
parent 218e6f98df
commit 44fc334c7a
3 changed files with 15 additions and 0 deletions

View File

@ -1770,6 +1770,7 @@ AC_CHECK_FUNCS([ \
strnlen \
strnvis \
strptime \
strsignal \
strtonum \
strtoll \
strtoul \

View File

@ -104,6 +104,16 @@ const char *strerror(int e)
}
#endif
#if !defined(HAVE_STRSIGNAL)
char *strsignal(int sig)
{
static char buf[16];
(void)snprintf(buf, sizeof(buf), "%d", sig);
return buf;
}
#endif
#ifndef HAVE_UTIMES
int utimes(char *filename, struct timeval *tvp)
{

View File

@ -49,6 +49,10 @@ int setegid(uid_t);
const char *strerror(int);
#endif
#if !defined(HAVE_STRSIGNAL)
char *strsignal(int);
#endif
#if !defined(HAVE_SETLINEBUF)
#define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0))
#endif