home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
LIBSRC.ZOO
/
libsrc
/
local
/
writev.c
< prev
Wrap
Text File
|
1992-01-27
|
471b
|
25 lines
#include <sys/types.h>
#include <sys/uio.h>
int writev (int fd, const struct iovec *iov, int iovcnt)
{
int i;
int accum = 0;
for (i = 0; i < iovcnt; ++i)
{
register count = iov[i].iov_len;
register thistime;
while (count)
{
if ((thistime = write (fd, iov[i].iov_base, count)) <= 0)
return (-1);
count -= thistime;
accum += thistime;
}
}
return (accum);
}