Jason Mawdsley wrote:
> 
> > > 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?

Mmap'ing /dev/zero gives you anopnymous pages; they can't
be not private.

It's pretty much the same thing.  I would use /dev/zero,
since it's portable.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to