Pages

Monday, December 28, 2009

HOW TO GET YOUR SYSTEM'S PAGE SIZE

IN WINDOWS

#include
#include

int main(void) {
SYSTEM_INFO si;
GetSystemInfo(&si);

printf("The page size for this system is %u bytes.\n", si.dwPageSize);

return 0;
}


IN LINUX
#include
#include // sysconf(3)

int main(void) {
printf("The page size for this system is %ld bytes.\n",
sysconf(_SC_PAGESIZE)); // _SC_PAGE_SIZE is OK too.

return 0;
}

No comments:

Post a Comment