]> git.proxmox.com Git - qemu.git/blobdiff - iov.c
change iov_* function prototypes to be more appropriate
[qemu.git] / iov.c
diff --git a/iov.c b/iov.c
index e7385c41f4ecc55f0234ba1cafd78f2fa1df0bbb..bc58cab05a833b905bc38770109768f2b20ea66c 100644 (file)
--- a/iov.c
+++ b/iov.c
  *
  * This work is licensed under the terms of the GNU GPL, version 2.  See
  * the COPYING file in the top-level directory.
+ *
+ * Contributions after 2012-01-13 are licensed under the terms of the
+ * GNU GPL, version 2 or (at your option) any later version.
  */
 
 #include "iov.h"
 
-size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt,
-                    const void *buf, size_t iov_off, size_t size)
+size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt, size_t iov_off,
+                    const void *buf, size_t size)
 {
     size_t iovec_off, buf_off;
     unsigned int i;
@@ -37,8 +40,8 @@ size_t iov_from_buf(struct iovec *iov, unsigned int iov_cnt,
     return buf_off;
 }
 
-size_t iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt,
-                  void *buf, size_t iov_off, size_t size)
+size_t iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt, size_t iov_off,
+                  void *buf, size_t size)
 {
     uint8_t *ptr;
     size_t iovec_off, buf_off;
@@ -62,8 +65,8 @@ size_t iov_to_buf(const struct iovec *iov, const unsigned int iov_cnt,
     return buf_off;
 }
 
-size_t iov_clear(const struct iovec *iov, const unsigned int iov_cnt,
-                 size_t iov_off, size_t size)
+size_t iov_memset(const struct iovec *iov, const unsigned int iov_cnt,
+                 size_t iov_off, int fillc, size_t size)
 {
     size_t iovec_off, buf_off;
     unsigned int i;
@@ -74,7 +77,7 @@ size_t iov_clear(const struct iovec *iov, const unsigned int iov_cnt,
         if (iov_off < (iovec_off + iov[i].iov_len)) {
             size_t len = MIN((iovec_off + iov[i].iov_len) - iov_off , size);
 
-            memset(iov[i].iov_base + (iov_off - iovec_off), 0, len);
+            memset(iov[i].iov_base + (iov_off - iovec_off), fillc, len);
 
             buf_off += len;
             iov_off += len;