From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nfw2o-0000iM-A1 for qemu-devel@nongnu.org; Fri, 12 Feb 2010 08:58:54 -0500 Received: from [199.232.76.173] (port=47939 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nfw2m-0000iE-Tk for qemu-devel@nongnu.org; Fri, 12 Feb 2010 08:58:52 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nfw2l-0007Z8-Ht for qemu-devel@nongnu.org; Fri, 12 Feb 2010 08:58:52 -0500 Received: from mx20.gnu.org ([199.232.41.8]:59110) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nfw2b-0007TZ-7c for qemu-devel@nongnu.org; Fri, 12 Feb 2010 08:58:51 -0500 Received: from mail2.shareable.org ([80.68.89.115]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nfw0v-0004NH-In for qemu-devel@nongnu.org; Fri, 12 Feb 2010 08:56:57 -0500 Date: Fri, 12 Feb 2010 13:56:38 +0000 From: Jamie Lokier Subject: Re: [Qemu-devel] Heads up: glibc preadv emulation breaks qemu on older kernels Message-ID: <20100212135638.GA26309@shareable.org> References: <20100211190608.GA26410@amd.home.annexia.org> <20100212125238.GA22221@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org, Christoph Hellwig , "Richard W.M. Jones" malc wrote: > On Fri, 12 Feb 2010, Christoph Hellwig wrote: > > > On Thu, Feb 11, 2010 at 07:06:08PM +0000, Richard W.M. Jones wrote: > > > One interesting thing is that qemu has its own preadv emulation (which > > > does the emulation correctly), but this is never used because qemu > > > never gets ENOSYS back from preadv. > > > > At this point the amount of bugs in the glibc preadv/pwritev code really > > make me want to go to use the raw system calls on Linux only. Any > > opinions from the maintainers if that is acceptable? > > There are more than one way to parse the first sentence, if it should be > read as: > On linux and on linux only avoid using pread/write[v] and talk to the > kernel directly. > > Then i agree. Do we know if BSDs have the same bug in some versions? There have been (very ancient now) unixes where libc "emulated" readv/writev, with the result that sending UDP packets broke, and TCP streams were excessively segmented. There have been more recently very dodgy libc emulations of pselect (not signal safe like it's entire point for existing). For that matter pread/pwrite having broken libc emulation too (not thread safe despite that being a main reason for existing). Did I mention I really, really hate libc "emulating" system calls badly. -- Jamie