readv.c

来自「package of develop dns」· C语言 代码 · 共 39 行

C
39
字号
#ifndef LINTstatic const char rcsid[] = "$Id: readv.c,v 1.1 2001/03/29 06:30:35 marka 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_READVint __bindcompat_readv;#elseint__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 */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?