From owner-freebsd-hackers Thu Feb 14 18:45:16 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.magmacom.com (mx1.magmacom.com [206.191.0.217]) by hub.freebsd.org (Postfix) with ESMTP id 92ECF37B419 for ; Thu, 14 Feb 2002 18:45:13 -0800 (PST) Received: from mail1.magma.ca (mail1.magma.ca [206.191.0.252]) by mx1.magmacom.com (Magma's Mail Server) with ESMTP id g1F2jCVw027711 for ; Thu, 14 Feb 2002 21:45:12 -0500 (EST) Received: from lucan (mothership.macadamian.com [206.191.21.204]) by mail1.magma.ca (Magma's Mail Server) with SMTP id g1F2jCMd029451 for ; Thu, 14 Feb 2002 21:45:12 -0500 (EST) Message-ID: <05e201c1b5cb$73a00520$2a64a8c0@macadamian.com> From: "Jason Mawdsley" To: Subject: mmap and PROT_WRITE Date: Thu, 14 Feb 2002 21:49:55 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG { void * p = mmap( 0, 1024, PROT_WRITE, MAP_ANON, -1, 0 ); if ( p ) { /* * pukes and dies * *((int*)(p)) = 5; */ } } { void * p = mmap( 0, 1024, PROT_WRITE | PROT_READ, MAP_ANON, -1, 0 ); if ( p ) { *((int*)(p)) = 5; } } Why can't I write to memory in the first case? Is there anyway I can implement writable but no readable memory? I read some where that there is no true write only memory do to the limitations of x86. TIA Jason Mawdsley ~ jason@macadamian.com Software Designer ~ m_ a c a d a m i a n t e c h n o l o g i e s "Software experts for the world's leading technology companies." http://www.macadamian.com Because software development cycles should not end in tragedy. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message