Bug 192396 - Userspace software relying on PAGE_SIZE is broken
Userspace software relying on PAGE_SIZE is broken
Product: Fedora
Classification: Fedora
Component: glibc-kernheaders (Show other bugs)
ppc64 Linux
medium Severity medium
: ---
: ---
Assigned To: David Woodhouse
Brian Brock
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2006-05-19 06:27 EDT by Thomas Woerner
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-05-19 08:39:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Thomas Woerner 2006-05-19 06:27:47 EDT
Description of problem:
There is no PAGE_SIZE define in /usr/include/asm/page.h for ppc64.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
Actual results:

Expected results:

Additional info:

The missing defines are:
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT      12
#define PAGE_SIZE       (1UL << PAGE_SHIFT)
#define PAGE_MASK       (~(PAGE_SIZE-1))
Comment 1 David Woodhouse 2006-05-19 06:40:24 EDT
Page size is variable; it is not a compile-time constant.

If the #define still exists in other architectures' page.h, that's a temporary
aberration and will also be fixed soon.

Use sysconf(_SC_PAGE_SIZE);
Comment 2 Thomas Woerner 2006-05-19 08:18:35 EDT
If there is no PAGE_SIZE anymore, then remove the include file. 

It does not make sense to have an empty include file.
Comment 3 David Woodhouse 2006-05-19 08:39:04 EDT
That's being worked upon. Some other files still include it without #ifdef
__KERNEL__ though -- so until those are cleaned up, the empty file is still
Comment 4 David Woodhouse 2006-05-19 09:31:35 EDT
(Clarifying since I expect to get duplicates...)


PAGE_SIZE (and PAGESIZE) are optional. Glibc has never defined them. Portable
software must cope with that and use sysconf(_SC_PAGE_SIZE).

Including kernel-private headers like <asm/page.h> is broken. That file is going
away (from user visibility) and in some architectures PAGE_SIZE has _already_
been removed from the user-visible parts of it. Page size can be variable, and
should be checked at runtime.

Note You need to log in before you can comment on or make changes to this bug.