bpd1069 / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

Add writev implementation to glibc_compat #210

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use writev from uio.h and link to glibc-compat

What is the expected output? What do you see instead?

undefined reference to 'writev'

What version of the product are you using? On what operating system?

pepper_41

Please provide any additional information below.

#include <sys/types.h>
#include <sys/uio.h>

ssize_t writev(int d, const struct iovec *iov, int iovcnt) {
  ssize_t N = 0;
  for (int i = 0; i < iovcnt; i++) {
    ssize_t n = write(d, iov[i].iov_base, iov[i].iov_len);
    if (n == -1) {
      return -1;
    }
    N += n;
  }
  return N;
}

Original issue reported on code.google.com by r.w.linc...@gmail.com on 28 Mar 2015 at 11:13