repo.or.cz
/
minix3.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Uninitialized vector entry?
[minix3.git]
/
lib
/
other
/
writev.c
blob
9bbf9a683c7840046e2ab61107d68de5167d6f79
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
}