From 2b6dbc39ef274d5298daad1ff864be8fc3c56537 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 10 Jul 2014 06:21:51 -0500 Subject: initial top-level import of subdirectories --- include/Makefile.am | 3 +++ include/machine/endian.h | 14 ++++++++++++++ include/openssl/Makefile.am.tpl | 5 +++++ include/stdlib.h | 16 ++++++++++++++++ include/string.h | 25 +++++++++++++++++++++++++ include/sys/types.h | 13 +++++++++++++ include/unistd.h | 9 +++++++++ 7 files changed, 85 insertions(+) create mode 100644 include/Makefile.am create mode 100644 include/machine/endian.h create mode 100644 include/openssl/Makefile.am.tpl create mode 100644 include/stdlib.h create mode 100644 include/string.h create mode 100644 include/sys/types.h create mode 100644 include/unistd.h (limited to 'include') diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..f2860a4 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = openssl + +noinst_HEADERS = pqueue.h stdlib.h string.h machine/endian.h diff --git a/include/machine/endian.h b/include/machine/endian.h new file mode 100644 index 0000000..4d96a6d --- /dev/null +++ b/include/machine/endian.h @@ -0,0 +1,14 @@ +#ifndef _COMPAT_BYTE_ORDER_H_ +#define _COMPAT_BYTE_ORDER_H_ + +#ifdef __linux__ +#include +#else +#ifdef __sun +#include +#else +#include_next +#endif +#endif + +#endif diff --git a/include/openssl/Makefile.am.tpl b/include/openssl/Makefile.am.tpl new file mode 100644 index 0000000..1375956 --- /dev/null +++ b/include/openssl/Makefile.am.tpl @@ -0,0 +1,5 @@ +include $(top_srcdir)/Makefile.am.common + +opensslincludedir=$(includedir)/openssl + +opensslinclude_HEADERS = diff --git a/include/stdlib.h b/include/stdlib.h new file mode 100644 index 0000000..6c2de93 --- /dev/null +++ b/include/stdlib.h @@ -0,0 +1,16 @@ +#include_next + +#ifndef LIBCRYPTOCOMPAT_STDLIB_H +#define LIBCRYPTOCOMPAT_STDLIB_H + +#include +#include +#include + +uint32_t arc4random(void); +void arc4random_buf(void *_buf, size_t n); +void *reallocarray(void *, size_t, size_t); +long long strtonum(const char *nptr, long long minval, + long long maxval, const char **errstr); + +#endif diff --git a/include/string.h b/include/string.h new file mode 100644 index 0000000..acdde6c --- /dev/null +++ b/include/string.h @@ -0,0 +1,25 @@ +#include_next + +#ifndef LIBCRYPTOCOMPAT_STRING_H +#define LIBCRYPTOCOMPAT_STRING_H + +#include + +#ifdef __sun +/* Some functions historically defined in string.h were placed in strings.h by + * SUS. Use the same hack as OS X and FreeBSD use to work around on Solaris. + */ +#include +#endif + +size_t strlcpy(char *dst, const char *src, size_t siz); + +size_t strlcat(char *dst, const char *src, size_t siz); + +void explicit_bzero(void *, size_t); + +int timingsafe_bcmp(const void *b1, const void *b2, size_t n); + +int timingsafe_memcmp(const void *b1, const void *b2, size_t len); + +#endif diff --git a/include/sys/types.h b/include/sys/types.h new file mode 100644 index 0000000..05fc05b --- /dev/null +++ b/include/sys/types.h @@ -0,0 +1,13 @@ +#include_next + +#ifndef LIBCRYPTOCOMPAT_SYS_TYPES_H +#define LIBCRYPTOCOMPAT_SYS_TYPES_H + +#include + +#ifdef __sun +typedef uint8_t u_int8_t; +typedef uint32_t u_int32_t; +#endif + +#endif diff --git a/include/unistd.h b/include/unistd.h new file mode 100644 index 0000000..ae82b95 --- /dev/null +++ b/include/unistd.h @@ -0,0 +1,9 @@ +#include_next + +#ifndef LIBCRYPTOCOMPAT_UNISTD_H +#define LIBCRYPTOCOMPAT_UNISTD_H + +int getentropy(void *buf, size_t buflen); +int issetugid(void); + +#endif -- cgit v1.2.3-55-g6feb