Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.programmer Subject: Re: when to use readv()/writev() ? Message-ID: <27539@mimsy.umd.edu> Date: 8 Nov 90 06:55:05 GMT References: <1990Nov8.041357.29013@decuac.dec.com> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 21 In article <1990Nov8.041357.29013@decuac.dec.com> mjr@decuac.dec.com (Marcus J. Ranum) writes: > If I have 2 iovecs with 500 and 524 bytes respectively is the >operation performed analogous to write(fd,buf,1024) or is it simply >write(fd,buf1,500), write(fd,buf2,524) with the kernel just doing >the legwork? The latter (except, potentially, to a character device, but there are no character devices in any Unix I have seen that do anything special with multiple IO vectors). > I see I still have to sum up the sizes of the contents of the >scatter/gather arrays so I can check the return of the write - doesn't >it get kind of icky when you have a partial writev()? Yes, it does. This is one of the reasons I elected not to use writev() in my stdio implementation (which has a stdio-level writev-like function whose main raison d'etre is printf()). -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris