From 02eedafcb393ef771ab6231d6583c58d12b97837 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sat, 20 Feb 2010 22:57:40 -0800 Subject: Add portable/uio.h and include it in client/wallet.c Now that the wallet client uses struct iovec, it needs to include the relevant header file. Import the portability layer for possible future Windows support. --- LICENSE | 5 +++-- Makefile.am | 2 +- client/wallet.c | 1 + configure.ac | 2 +- portable/uio.h | 27 +++++++++++++++++++++++++++ 5 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 portable/uio.h diff --git a/LICENSE b/LICENSE index 8eca7ad..bd01ed1 100644 --- a/LICENSE +++ b/LICENSE @@ -74,8 +74,9 @@ license: OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. The files portable/asprintf.c, portable/dummy.c, portable/macros.h, -portable/stdbool.h, portable/strlcat.c, portable/strlcpy.c, and -util/concat.c have been placed in the public domain by their author. +portable/stdbool.h, portable/strlcat.c, portable/strlcpy.c, +portable/uio.h, and util/concat.c have been placed in the public domain by +their author. The file portable/snprintf.c is released under the following license: diff --git a/Makefile.am b/Makefile.am index 05ffe53..162a0f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -44,7 +44,7 @@ EXTRA_DIST = LICENSE autogen client/wallet.pod config/allow-extract \ noinst_LIBRARIES = portable/libportable.a util/libutil.a portable_libportable_a_SOURCES = portable/dummy.c portable/krb5-extra.c \ portable/krb5.h portable/macros.h portable/stdbool.h \ - portable/system.h + portable/system.h portable/uio.h portable_libportable_a_CPPFLAGS = $(KRB5_CPPFLAGS) portable_libportable_a_LIBADD = $(LIBOBJS) util_libutil_a_SOURCES = util/concat.c util/concat.h util/macros.h \ diff --git a/client/wallet.c b/client/wallet.c index dc4fe18..e6d8eb9 100644 --- a/client/wallet.c +++ b/client/wallet.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include diff --git a/configure.ac b/configure.ac index 5c3da92..c4dc7eb 100644 --- a/configure.ac +++ b/configure.ac @@ -33,7 +33,7 @@ AC_CHECK_MEMBERS([krb5_keytab_entry.keyblock], , , [#include ]) RRA_LIB_KRB5_RESTORE AC_HEADER_STDBOOL -AC_CHECK_HEADERS([sys/bitypes.h syslog.h]) +AC_CHECK_HEADERS([sys/bitypes.h sys/uio.h syslog.h]) AC_CHECK_DECLS([snprintf, vsnprintf]) RRA_C_C99_VAMACROS RRA_C_GNU_VAMACROS diff --git a/portable/uio.h b/portable/uio.h new file mode 100644 index 0000000..3c9e840 --- /dev/null +++ b/portable/uio.h @@ -0,0 +1,27 @@ +/* + * Portability wrapper around . + * + * Provides a definition of the iovec struct for platforms that don't have it + * (primarily Windows). Currently, the corresponding readv and writev + * functions are not provided or prototyped here. + * + * Written by Russ Allbery + * This work is hereby placed in the public domain by its author. + */ + +#ifndef PORTABLE_UIO_H +#define PORTABLE_UIO_H 1 + +#include + +/* remctl.h provides its own definition of this struct on Windows. */ +#if defined(HAVE_SYS_UIO_H) +# include +#elif !defined(REMCTL_H) +struct iovec { + void *iov_base; + size_t iov_len; +}; +#endif + +#endif /* !PORTABLE_UIO_H */ -- cgit v1.2.3