From owner-freebsd-hackers Thu Dec 2 9: 3:29 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.tvol.com (mail.wgate.com [38.219.83.4]) by hub.freebsd.org (Postfix) with ESMTP id 1CFCC14CA6 for ; Thu, 2 Dec 1999 09:03:26 -0800 (PST) (envelope-from rjesup@wgate.com) Received: from jesup.eng.tvol.net (jesup.eng.tvol.net [10.32.2.26]) by mail.tvol.com (8.8.8/8.8.3) with ESMTP id MAA22150; Thu, 2 Dec 1999 12:02:03 -0500 (EST) Reply-To: Randell Jesup To: Matthew Dillon , freebsd-hackers@freebsd.org Subject: Re: writing to an mmap()'ed region requires read access? From: Randell Jesup Date: 02 Dec 1999 12:04:31 -0500 In-Reply-To: Matthew Dillon's message of "Tue, 30 Nov 1999 23:28:44 -0800 (PST)" Message-ID: X-Mailer: Gnus v5.6.43/Emacs 20.4 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon writes: >:I was just playing with mmap() really for the first time, and I noticed >:something a bit odd. When you mmap() a file for writing, it also appears >:to require that you give it read permissions, else it dies on a signal 10. > > I've got a few hundred terrabytes of WOM to sell ya! I'll sell you a few petabytes! > This is just a byproduct of the MMU implementation. Most MMU's do > not support write-only maps because most do not implement separate > read and write bits. You get a valid and a write-enable bit instead, > or you just get a valid bit and have to use the dirty bit to make the > page writable (no write-enable bit at all). Makes sense. Shouldn't the mmap() return MAP_FAILED, probably with EACCES, instead of causing a signal 10? -- Randell Jesup, Worldgate Communications, ex-Scala, ex-Amiga OS team ('88-94) rjesup@wgate.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message