From 782310cb5a9655be9316299e65a61ab4ace16d11 Mon Sep 17 00:00:00 2001
From: Vladimir Sedach <vsedach@gmail.com>
Date: Fri, 13 Nov 2009 23:09:26 -0500
Subject: [PATCH 1/5] Added writev system call.

---
 src/syscalls/ffi-functions-unix.lisp |    7 +++++++
 src/syscalls/pkgdcl.lisp             |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/syscalls/ffi-functions-unix.lisp b/src/syscalls/ffi-functions-unix.lisp
index 22efcae..8cbe5fb 100644
--- a/src/syscalls/ffi-functions-unix.lisp
+++ b/src/syscalls/ffi-functions-unix.lisp
@@ -94,6 +94,13 @@ The two memory areas may overlap."
   (buf   :pointer)
   (count size-t))
 
+(defsyscall (%sys-writev "writev")
+    (ssize-t :restart t :handle fd)
+  "Writes the contents of the first IOVCOUNT buffers of the IOV array to the FD."
+  (fd :int)
+  (iov :pointer)
+  (iovcount :int))
+
 (defsyscall (%sys-pread (#+linux "pread64" "pread"))
     (ssize-t :restart t :handle fd)
   "Read at most COUNT bytes from FD at offset OFFSET into the foreign area BUF."
diff --git a/src/syscalls/pkgdcl.lisp b/src/syscalls/pkgdcl.lisp
index f7e2928..f9f2723 100644
--- a/src/syscalls/pkgdcl.lisp
+++ b/src/syscalls/pkgdcl.lisp
@@ -87,6 +87,7 @@
    ;; Files
    #:%sys-read
    #:%sys-write
+   #:%sys-writev
    #:%sys-pread
    #:%sys-pwrite
    #:%sys-open
-- 
1.6.3.3

