Line | |
---|
1 | #include <errno.h>
|
---|
2 | #include <stdio.h>
|
---|
3 | #include <sys/uio.h>
|
---|
4 |
|
---|
5 | ssize_t writev(int fildes, const struct iovec *iov, int iovcnt)
|
---|
6 | {
|
---|
7 | #if DEBUG
|
---|
8 | fprintf(stderr, "bind: not implemented for fd %d\n", socket);
|
---|
9 | #endif
|
---|
10 | errno= ENOSYS;
|
---|
11 | return -1;
|
---|
12 |
|
---|
13 | #if 0
|
---|
14 | int i, r;
|
---|
15 | char *p;
|
---|
16 | ssize_t l, sum;
|
---|
17 |
|
---|
18 | /* We should buffer */
|
---|
19 | sum= 0;
|
---|
20 | for (i= 0; i<iovcnt; i++)
|
---|
21 | {
|
---|
22 | p= iov[i].iov_base;
|
---|
23 | l= iov[i].iov_len;
|
---|
24 | while (l > 0)
|
---|
25 | {
|
---|
26 | r= write(fildes, p, l);
|
---|
27 | if (r <= 0)
|
---|
28 | {
|
---|
29 | assert(sum == 0);
|
---|
30 | return r;
|
---|
31 | }
|
---|
32 | p += r;
|
---|
33 | l -= r;
|
---|
34 | sum += r;
|
---|
35 | }
|
---|
36 | }
|
---|
37 | return sum;
|
---|
38 | #endif
|
---|
39 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.