From a6d7ea956290470254e817adb2f6a3fac9397a17 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 31 Jan 2019 09:45:56 -0600 Subject: update autoconf for latest compat functions --- include/compat/stdlib.h | 4 ++++ include/compat/syslog.h | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 include/compat/syslog.h (limited to 'include') diff --git a/include/compat/stdlib.h b/include/compat/stdlib.h index cc04856..e629884 100644 --- a/include/compat/stdlib.h +++ b/include/compat/stdlib.h @@ -29,6 +29,10 @@ uint32_t arc4random_uniform(uint32_t upper_bound); void freezero(void *ptr, size_t sz); #endif +#ifndef HAVE_GETPROGNAME +const char * getprogname(void); +#endif + #ifndef HAVE_REALLOCARRAY void *reallocarray(void *, size_t, size_t); #endif diff --git a/include/compat/syslog.h b/include/compat/syslog.h new file mode 100644 index 0000000..f400ff6 --- /dev/null +++ b/include/compat/syslog.h @@ -0,0 +1,37 @@ +/* + * Public domain + * syslog.h compatibility shim + */ + +#ifndef _WIN32 +#include_next +#endif + +#ifndef LIBCRYPTOCOMPAT_SYSLOG_H +#define LIBCRYPTOCOMPAT_SYSLOG_H + +#ifndef HAVE_SYSLOG_R + +#include + +#ifdef _WIN32 +#define LOG_INFO 6 /* informational */ +#define LOG_USER (1<<3) /* random user-level messages */ +#define LOG_LOCAL2 (18<<3) /* reserved for local use */ +#endif + +struct syslog_data { + int log_stat; + const char *log_tag; + int log_fac; + int log_mask; +}; + +#define SYSLOG_DATA_INIT {0, (const char *)0, LOG_USER, 0xff} + +void syslog_r(int, struct syslog_data *, const char *, ...); +void vsyslog_r(int, struct syslog_data *, const char *, va_list); + +#endif + +#endif -- cgit v1.2.3-55-g6feb