Uninitialized vector entry?
[minix3.git] / lib / other / writev.c
blob9bbf9a683c7840046e2ab61107d68de5167d6f79
1 #include <errno.h>
2 #include <stdio.h>
3 #include <sys/uio.h>
5 ssize_t writev(int fildes, const struct iovec *iov, int iovcnt)
7 #if DEBUG
8 fprintf(stderr, "bind: not implemented for fd %d\n", socket);
9 #endif
10 errno= ENOSYS;
11 return -1;
13 #if 0
14 int i, r;
15 char *p;
16 ssize_t l, sum;
18 /* We should buffer */
19 sum= 0;
20 for (i= 0; i<iovcnt; i++)
22 p= iov[i].iov_base;
23 l= iov[i].iov_len;
24 while (l > 0)
26 r= write(fildes, p, l);
27 if (r <= 0)
29 assert(sum == 0);
30 return r;
32 p += r;
33 l -= r;
34 sum += r;
37 return sum;
38 #endif