From: Wyllys I. <Wyllys.Ingersoll@Sun.COM> - 2010-01-29 19:24:50
|
I found this on the Ubuntu manpage for "mlock": ... Linux Notes Under Linux, mlock() and munlock() automatically round addr down to the nearest page boundary. However, POSIX.1-2001 allows an implementation to require that addr is page aligned, so portable applications should ensure this. ... So, while it appears that it is probably safe to NOT worry about alignment on Linux, it doesn't hurt to ensure it. The code I submitted ensures the alignment for Solaris, but will fail on Linux because some of the macros are not defined. I can fix it, though. Once you know PAGESIZE, it is easy to compute PAGEOFFSET and PAGEMASK. I will work up a new patch and submit one that will compile under Linux as well. -Wyllys |