Bug 192396 - Userspace software relying on PAGE_SIZE is broken
Summary: Userspace software relying on PAGE_SIZE is broken
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc-kernheaders
Version: rawhide
Hardware: ppc64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Woodhouse
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-19 10:27 UTC by Thomas Woerner
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-05-19 12:39:04 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Thomas Woerner 2006-05-19 10:27:47 UTC
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):
glibc-kernheaders-3.0-34

How reproducible:

Steps to Reproduce:
1.
2.
3.
  
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 10:40:24 UTC
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 12:18:35 UTC
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 12:39:04 UTC
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
required.

Comment 4 David Woodhouse 2006-05-19 13:31:35 UTC
(Clarifying since I expect to get duplicates...)

http://www.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

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.