diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/compat/stdlib.h | 4 | ||||
-rw-r--r-- | include/compat/syslog.h | 37 |
2 files changed, 41 insertions, 0 deletions
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); | |||
29 | void freezero(void *ptr, size_t sz); | 29 | void freezero(void *ptr, size_t sz); |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #ifndef HAVE_GETPROGNAME | ||
33 | const char * getprogname(void); | ||
34 | #endif | ||
35 | |||
32 | #ifndef HAVE_REALLOCARRAY | 36 | #ifndef HAVE_REALLOCARRAY |
33 | void *reallocarray(void *, size_t, size_t); | 37 | void *reallocarray(void *, size_t, size_t); |
34 | #endif | 38 | #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 @@ | |||
1 | /* | ||
2 | * Public domain | ||
3 | * syslog.h compatibility shim | ||
4 | */ | ||
5 | |||
6 | #ifndef _WIN32 | ||
7 | #include_next <syslog.h> | ||
8 | #endif | ||
9 | |||
10 | #ifndef LIBCRYPTOCOMPAT_SYSLOG_H | ||
11 | #define LIBCRYPTOCOMPAT_SYSLOG_H | ||
12 | |||
13 | #ifndef HAVE_SYSLOG_R | ||
14 | |||
15 | #include <stdarg.h> | ||
16 | |||
17 | #ifdef _WIN32 | ||
18 | #define LOG_INFO 6 /* informational */ | ||
19 | #define LOG_USER (1<<3) /* random user-level messages */ | ||
20 | #define LOG_LOCAL2 (18<<3) /* reserved for local use */ | ||
21 | #endif | ||
22 | |||
23 | struct syslog_data { | ||
24 | int log_stat; | ||
25 | const char *log_tag; | ||
26 | int log_fac; | ||
27 | int log_mask; | ||
28 | }; | ||
29 | |||
30 | #define SYSLOG_DATA_INIT {0, (const char *)0, LOG_USER, 0xff} | ||
31 | |||
32 | void syslog_r(int, struct syslog_data *, const char *, ...); | ||
33 | void vsyslog_r(int, struct syslog_data *, const char *, va_list); | ||
34 | |||
35 | #endif | ||
36 | |||
37 | #endif | ||