[BACK]Return to readv.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / dist / bind / lib / bind / bsd

File: [cvs.NetBSD.org] / src / dist / bind / lib / bind / bsd / Attic / readv.c (download)

Revision 1.1.1.3 (vendor branch), Sat Jun 21 18:33:13 2008 UTC (15 years, 10 months ago) by christos
Branch: ISC
CVS Tags: wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, netbsd-5-base, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, bind-9-5-0-P2, bind-9-5-0-P1, bind-9-5-0
Branch point for: netbsd-5-1, netbsd-5-0, netbsd-5, jym-xensuspend
Changes since 1.1.1.2: +1 -1 lines

import bind-9-5-0

/*	$NetBSD: readv.c,v 1.1.1.3 2008/06/21 18:33:13 christos Exp $	*/

#ifndef LINT
static const char rcsid[] = "Id: readv.c,v 1.2 2005/04/27 04:56:11 sra Exp";
#endif

#include "port_before.h"

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

#include "port_after.h"

#ifndef NEED_READV
int __bindcompat_readv;
#else

int
__readv(fd, vp, vpcount)
	int fd;
	const struct iovec *vp;
	int vpcount;
{
	int count = 0;

	while (vpcount-- > 0) {
		int bytes = read(fd, vp->iov_base, vp->iov_len);

		if (bytes < 0)
			return (-1);
		count += bytes;
		if (bytes != vp->iov_len)
			break;
		vp++;
	}
	return (count);
}
#endif /* NEED_READV */
/*! \file */