summaryrefslogtreecommitdiff
path: root/portable/uio.h
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-02-21 17:45:55 -0800
committerRuss Allbery <rra@stanford.edu>2010-02-21 17:45:55 -0800
commit60210334fa3dbd5dd168199063c6ee850d750d0c (patch)
tree31e832ba6788076075d38e20ffd27ebf09430407 /portable/uio.h
parente571a8eb96f42de5a114cf11ff1c3d63e5a8d301 (diff)
Imported Upstream version 0.10
Diffstat (limited to 'portable/uio.h')
-rw-r--r--portable/uio.h27
1 files changed, 27 insertions, 0 deletions
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 */