Date: Fri, 07 Dec 2007 13:54:00 +0100 From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no> To: "Vlad GALU" <dudu@dudu.ro> Cc: freebsd-fs@freebsd.org, Ivan Voras <ivoras@freebsd.org> Subject: Re: readv: parallel or sequential? Message-ID: <868x46u0lz.fsf@ds4.des.no> In-Reply-To: <ad79ad6b0712070347s4a5d5bb2rc7adfdc54b107dac@mail.gmail.com> (Vlad GALU's message of "Fri\, 7 Dec 2007 13\:47\:25 %2B0200") References: <fjbb3v$n60$1@ger.gmane.org> <ad79ad6b0712070347s4a5d5bb2rc7adfdc54b107dac@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
"Vlad GALU" <dudu@dudu.ro> writes: > Ivan Voras <ivoras@freebsd.org> writes: > > Does this mean that, in effect, readv() is just a loop of read() > > calls (minus syscall overhead)? > read() is just a particular case of readv() (with only one iovec > struct, plus the full buffer size), they both call kern_readv(), so > the effect is the same. I assume the manpage means that the iovec > structures are filled sequentially rather than in parallel. Interestingly, Linux does it the other way around - a device driver can implement readv() and writev(), but if it doesn't, the kernel will fall back to a default implementation which calls the driver's read() or write() method once for each iov. But to return to what Ivan was asking, I think what the man page is trying to say is that you can't use readv() to e.g. read individual network packets into separate buffers (unless each packet just happens to fit exactly within each buffer). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?868x46u0lz.fsf>