aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LICENSE5
-rw-r--r--Makefile.am2
-rw-r--r--client/wallet.c1
-rw-r--r--configure.ac2
-rw-r--r--portable/uio.h27
5 files changed, 33 insertions, 4 deletions
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 <config.h>
#include <portable/krb5.h>
#include <portable/system.h>
+#include <portable/uio.h>
#include <errno.h>
#include <remctl.h>
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 <krb5.h>])
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 <sys/uio.h>.
+ *
+ * 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 <rra@stanford.edu>
+ * This work is hereby placed in the public domain by its author.
+ */
+
+#ifndef PORTABLE_UIO_H
+#define PORTABLE_UIO_H 1
+
+#include <sys/types.h>
+
+/* remctl.h provides its own definition of this struct on Windows. */
+#if defined(HAVE_SYS_UIO_H)
+# include <sys/uio.h>
+#elif !defined(REMCTL_H)
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+#endif
+
+#endif /* !PORTABLE_UIO_H */