title: writev on windows
body: <p>Does Windows offer anything similar to writev in a non Cygwin environment?</p>
  
  <p>Ideally, an answer would have a working example for windows, something along the lines of:</p>
  
  <pre><code>#include &lt;sys/types.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;fcntl.h&gt;
  #include &lt;sys/uio.h&gt;
  
  int main() {
    struct iovec iov[2];
    char blah[][20] = { "mickey", " mouse" };
    int fd = open ("/tmp/mice.txt", O_WRONLY | O_CREAT);
    iov[0].iov_base=blah[0];
    iov[1].iov_base=blah[1];
    iov[0].iov_len=iov[1].iov_len=6;
    writev(fd, iov, 2 );
    close(fd);
  }
  </code></pre>
  
  <p>The answer should be how to approach the problem using system calls. Specifically I am looking to avoid copying the individual buffers into a single larger buffer to perform the write. Also the resultant write should be a single large write request instead of something like fwrite which performs buffered IO.</p>
  
  <hr>
  
  <p><em><strong>Edit</strong>: 13 August 12</em></p>
  
  <p>The link to Scatter Gather I/O seems to pertain primarily to TCP/IP networking (err winsock really). Another suggestion, which is writefilegather is a solution for writing files in a very specific format. I.e. whereas writev writes using iov containers (arbitrary blocks of memory), writefilegather uses fixed buffers aligned to page table size. </p>