From afc1676d9f8d91f0c42cbabd2b770bea587d889b Mon Sep 17 00:00:00 2001 From: gdr-ftp Date: Wed, 24 Jun 1998 04:22:38 +0000 Subject: [PATCH] syscall.c: - added readv (untested) and writev (tested) --- lib/libc/sys/syscall.c | 82 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/syscall.c b/lib/libc/sys/syscall.c index 1e5e6fa..5aa9ea9 100644 --- a/lib/libc/sys/syscall.c +++ b/lib/libc/sys/syscall.c @@ -9,7 +9,7 @@ * Unless otherwise specified, see the respective man pages for details * about these routines. * - * $Id: syscall.c,v 1.6 1997/12/21 20:13:19 gdr Exp $ + * $Id: syscall.c,v 1.7 1998/06/24 04:22:38 gdr-ftp Exp $ * * This file is formatted with tab stops every 3 columns. */ @@ -31,6 +31,7 @@ segment "libc_sys__"; #include #include #include +#include #include #include #include @@ -780,6 +781,46 @@ read (int filds, void *buf, size_t bytecount) { return result; } +/* + * readv + * + * HACK ALERT: This won't work right for packet based sockets. + */ +ssize_t +readv (int fd, const struct iovec *datavec, int count) { + IORecGS iorec = { 4, fd, NULL, 0L, 0L }; + int n, err; + size_t i, iov_len; + char *p, *iov_base; + ssize_t transferCount; + + transferCount = 0; + for (n=0; n