AC_SEARCH_LIBS([setproctitle], [util bsd])
AC_REPLACE_FUNCS([setproctitle])
AC_CHECK_FUNCS([setproctitle_init])
-AC_REPLACE_FUNCS([strlcpy strnlen strndup fgetln asprintf])
+AC_REPLACE_FUNCS([strlcpy strnlen strndup fgetln asprintf vsyslog])
AC_CHECK_FUNCS([setresuid setresgid])
case " $LIBS " in
#endif
#if !HAVE_ASPRINTF
-int vasprintf(char **str, const char *fmt, va_list ap) __attribute__ ((format (printf, 2, 0)));
+int vasprintf(char **, const char *, va_list) __attribute__ ((format (printf, 2, 0)));
int asprintf (char **, const char *, ...) __attribute__ ((format (printf, 2, 3)));
#endif
+#if !HAVE_VSYSLOG
+void vsyslog(int, const char *, va_list) __attribute__ ((format (printf, 2, 0)));
+#endif
+
#if !HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t);
#endif
--- /dev/null
+/* -*- mode: c; c-file-style: "openbsd" -*- */
+
+#include <stdlib.h>
+#include <syslog.h>
+#include "compat.h"
+
+/* vsyslog() doesn't exist on HP-UX */
+void
+vsyslog(int facility, const char *format, va_list ap) {
+ char *msg = NULL;
+ vasprintf(&msg, format, ap);
+ if (!msg) return;
+ syslog(facility, "%s", msg);
+ free(msg);
+}