Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Dec 1995 09:56:57 +0100 (MET)
From:      J Wunsch <j@uriah.heep.sax.de>
To:        freebsd-hackers@freebsd.org (FreeBSD hackers)
Subject:   Re: MMAP with MAP_FIXED
Message-ID:  <199512240856.JAA29891@uriah.heep.sax.de>
In-Reply-To: <199512240030.SAA23720@main.gbdata.com> from "Gary Clark II" at Dec 23, 95 06:30:19 pm

next in thread | previous in thread | raw e-mail | index | archive | help
As Gary Clark II wrote:

> Can anyone give me an example of using mmap with MAP_FIXED?  Or maybe just
> the macro that will put my address on a page bondary.

int pagesize = getpagesize();
caddr_t a;

...

a = ...;

/* this rounds a up to the next page boundary */

a = (caddr_t)(((int)a | (pagesize - 1)) + 1);


Perhaps there are even macros available.

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512240856.JAA29891>