From owner-freebsd-hackers Fri Nov 9 11:56:26 2001 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 0A85537B419 for ; Fri, 9 Nov 2001 11:56:24 -0800 (PST) Received: from mail6.magma.ca (mail6 [206.191.0.248]) by mx1.magmacom.com (8.9.3/8.9.3) with ESMTP id OAA21340; Fri, 9 Nov 2001 14:56:23 -0500 (EST) Received: from lucan (mothership.macadamian.com [206.191.21.204]) by mail6.magma.ca (8.9.3/8.9.3) with SMTP id OAA14592; Fri, 9 Nov 2001 14:56:22 -0500 (EST) Message-ID: <019401c16959$4e64a8b0$2a64a8c0@macadamian.com> From: "Jason Mawdsley" To: Cc: References: <200111081947.fA8JlAe03457@web.cs.ndsu.nodak.edu> <02ae01c16891$4c1f4970$2a64a8c0@macadamian.com> <3BEB0A57.3C510C49@mindspring.com> Subject: Re: mmap/madvise Date: Fri, 9 Nov 2001 15:01:22 -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 > > I am creating a virtual memory manager. > > > > Currently I am doing a > > mmap(...PROT_NONE, MAP_ANON ) to reserve the memory. > > then when committing the memory I am using mprotect( ...PROT_READ | > > PROT_WRITE ) > > mmap For reservation of memory; you should > mmap the fd for /dev/zero, with MAP_ANON > to grab pages initially. The man pages state that the fd must be -1 for MAP_ANON. an open() /dev/zero will return an valid file descriptor. So how would I mmap using /dev/zero? > Too bad there isn't an "Advance UNIX programming for Windows > Programmers" book. 8-(. Sounds like their could be a good market for one ;-) Jason 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 developers for the world's leading technology companies." http://www.macadamian.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message