Re: [PATCH] remove PAGE_SIZE from headers_install

H. Peter Anvin
2007-07-15T03:20:10Z

Albert Cahalan wrote:
>
> A real constant-value PAGE_SIZE is useful and doable.
>
> It's useful because a getpagesize() can't be used for numerous
> things, such as setting the size of an array.
>
> It's doable, even on architectures that support multiple page
> sizes, because ABIs specify alignment requirements. There are
> two alignments of interest here:
>
> a. the smallest that mmap() will ever naturally return on any
> correct implementation of the architecture's ABI ("naturally"
> meaning that MAP_FIXED was not used)
>
> b. the smallest that mprotect() will tolerate on all
> correct implementations of the architecture
>
> Pick either to be the Linux definition of PAGE_SIZE.
>

If you specify it to be one of these, people will mis-use it for the
other. This is a bad idea.

-hpa