2013-10-29 15:36:18 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include "util.h"
|
|
|
|
|
|
|
|
static void
|
|
|
|
usage(void)
|
|
|
|
{
|
|
|
|
eprintf("usage: %s\n", argv0);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
long pagesz;
|
|
|
|
|
|
|
|
ARGBEGIN {
|
|
|
|
default:
|
|
|
|
usage();
|
|
|
|
} ARGEND;
|
|
|
|
|
|
|
|
pagesz = sysconf(_SC_PAGESIZE);
|
2013-10-29 15:44:25 +00:00
|
|
|
if (pagesz <= 0) {
|
2013-10-29 15:36:18 +00:00
|
|
|
pagesz = sysconf(_SC_PAGE_SIZE);
|
2013-10-29 15:44:25 +00:00
|
|
|
if (pagesz <= 0)
|
2013-10-29 15:36:18 +00:00
|
|
|
enprintf(EXIT_FAILURE, "can't determine pagesize\n");
|
|
|
|
}
|
|
|
|
printf("%ld\n", pagesz);
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|