diff --git a/acinclude.m4 b/acinclude.m4 index 6a0db8a5a0..99947094cc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1210,7 +1210,7 @@ AC_SUBST(BUILD_LOGIN) AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec flock) AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror strcasestr) -AC_CHECK_FUNCS(setvbuf) +AC_CHECK_FUNCS(setvbuf vsyslog) AC_FUNC_SETVBUF_REVERSED AC_CHECK_FUNCS(regcomp regexec regerror) AC_MSG_CHECKING([for POSIX regex library]) diff --git a/src/util/snprintf.c b/src/util/snprintf.c index ca511a1b8f..7f2452c7f4 100644 --- a/src/util/snprintf.c +++ b/src/util/snprintf.c @@ -521,6 +521,16 @@ vsnprintf(char *p, unsigned int avail, char *fmt, va_list ap) } #endif /* AFS_OSF20_ENV || AFS_AIX32_ENV */ +#ifndef HAVE_VSYSLOG +void +vsyslog(int priority, const char *format, va_list args) +{ + char buf[1024]; + vsnprintf(buf, sizeof(buf), format, args); + syslog(priority, "%s", buf); +} +#endif + #ifndef AFS_NT40_ENV #if defined(AFS_OSF20_ENV) && !defined(AFS_DUX50_ENV) || defined(AFS_AIX32_ENV) || (defined(AFS_SUN55_ENV) && !defined(AFS_SUN56_ENV)) || !defined(HAVE_SNPRINTF)