Re: PAGE_SIZE Availability Inconsistency

From: Christoph Hellwig
Date: Thu Mar 08 2007 - 11:09:11 EST


On Thu, Mar 08, 2007 at 07:53:49AM -0800, Arjan van de Ven wrote:
> > > > PAGE_SIZE should not be available at all. Please use getpagesize()
> > > > instead.
> > >
> > > While I agree, NBPG is a bit of a problem, although it's only needed for aout
> > > coredumps AFAICT, but still needed to compile e.g. gdb.
> >
> > So we should export this one with an arbitrary value (on multiple page
> > size architectures) and a warning, maybe even an __deprecated attached to
> > it.
>
> if we think the kernel should export this one, we could do
>
> #ifndef __KERNEL__
> #define PAGE_SIZE getpagesize()
> #endif

No, no no. We should never export PAGE_SIZE. We might export NBPG
as deprecated symbol for gdb if it really needs it, but that should
happen only on a.out systems, and it it should be a true constant,
not depending on PAGE_SIZE.

I've Cc'ed the gdb list on whether they have any comments on this
issue.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/