This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: pageshift?


> Date: Sat, 21 Oct 2000 09:20:07 -0700 (PDT)
> From: Jack Howarth <howarth@bromo.med.uc.edu>
> 
> Hi,
>     On ppc our maintainer Paul Mackerras <paulus@linuxcare.com>
> for Linux 2.4 has decided to place tight wrappers around our
> asm-ppc kernel headers of the form...
> 
> #ifdef __KERNEL__
> 
> #endif /* __KERNEL__ */

I very much approve of this.  Thanks Paul!

> While the breakage of userland programs incorrectly using
> kernel headers isn't as bad as I feared,  I have found that
> procps from Redhat 7.0 has a sprinkling of PAGE_SIZE and 
> PAGE_SHIFT obtained from asm/page.h.
> I believe they should be able to get PAGE_SIZE from
> the _getpagesize() call declared in sys/shm.h however I am
> unclear how to back calculate PAGE_SHIFT. The asm/page.h header
> contains...

PAGE_SHIFT is just (ffs (getpagesize ())-1).  Don't use __getpagesize,
it's internal-only, use getpagesize() from unistd.h.  There are no
parameters to getpagesize().

-- 
- Geoffrey Keating <geoffk@cygnus.com>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]