Wednesday, July 28, 2010

PAGE_SIZE undefined

I ran into a couple of build failure on x86_64 architecture because the PAGE_SIZE variable in not defined. This 32-bit version of the same package builds fine, it is only the 64-bit ones that fail.


One straight forward fix to this problem would be to use sysconf(_SC_PAGESIZE) instead of PAGE_SIZE variable. This will query system to get the right page size.

Also remember to make sure unistd.h file is included when using the above mentioned sysconf call.


Praveen

No comments:

Post a Comment