Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: why limit of 16 iovec's in readv/writev? Keywords: iovec readv writev Message-ID: <20891@mimsy.umd.edu> Date: 23 Nov 89 00:22:13 GMT References: <473@siswat.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 17 In article <473@siswat.UUCP> buck@siswat.UUCP (A. Lester Buck) writes: >[why is there a limit of 16 iovec vectors]? Since the array of iovec structures must exist in kernel space (for reasons having to do with cleanliness and security in the rest of the kernel), they are `created' on the kernel stack during a sendmsg() or recvmsg() (or readv() or writev()) call, and the user values are copied into this local array. It has a `reasonable' bounded size. 4.4BSD already uses the kernel malloc for readv() and writev(), and allows 8 `free' iovec structures (on the stack) or up to 1024 `expensive' iovec structures (via malloc+io+free). The same could be done for sendmsg and recvmsg, but I suspect there is a bit less incentive. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris