summaryrefslogtreecommitdiff
path: root/src/libstddjb/iovec_from_siovec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstddjb/iovec_from_siovec.c')
-rw-r--r--src/libstddjb/iovec_from_siovec.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libstddjb/iovec_from_siovec.c b/src/libstddjb/iovec_from_siovec.c
new file mode 100644
index 0000000..154cca5
--- /dev/null
+++ b/src/libstddjb/iovec_from_siovec.c
@@ -0,0 +1,14 @@
+/* ISC license. */
+
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <skalibs/siovec.h>
+
+void iovec_from_siovec (struct iovec *iov, siovec_t const *v, unsigned int n)
+{
+ while (n--)
+ {
+ iov[n].iov_base = v[n].s ;
+ iov[n].iov_len = v[n].len ;
+ }
+}