From owner-freebsd-hackers Tue Oct 21 11:13:37 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA00431 for hackers-outgoing; Tue, 21 Oct 1997 11:13:37 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id LAA00422 for ; Tue, 21 Oct 1997 11:13:31 -0700 (PDT) (envelope-from toor@dyson.iquest.net) Received: (from root@localhost) by dyson.iquest.net (8.8.7/8.8.5) id NAA02391; Tue, 21 Oct 1997 13:13:23 -0500 (EST) From: "John S. Dyson" Message-Id: <199710211813.NAA02391@dyson.iquest.net> Subject: Re: PROT_READ needed for read() call? In-Reply-To: from Erik E Rantapaa at "Oct 21, 97 11:04:56 am" To: rantapaa@uswest.net (Erik E Rantapaa) Date: Tue, 21 Oct 1997 13:13:23 -0500 (EST) Cc: freebsd-hackers@FreeBSD.ORG Reply-To: dyson@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Erik E Rantapaa said: > > While porting some code to FreeBSD 2.2-STABLE I noticed that in order > to read() into a mmap-ed address space you need PROT_READ as well as > PROT_WRITE, otherwise you get a "Bad address" error (EFAULT). > The original code (Solaris) only requires PROT_WRITE. > > This is not a big deal, but I was wondering what the current thinking > was on such issues. > As I remember, POSIX suggests/requires PROT_WRITE also imply PROT_READ. If it does, I'll correct the situation. (I have a copy of POSIX.) -- John dyson@freebsd.org jdyson@nc.com