2013-10-29 11:36:18 -04:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2014-06-30 14:03:41 -04:00
|
|
|
#include <unistd.h>
|
|
|
|
|
2013-10-29 11:36:18 -04:00
|
|
|
#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 11:44:25 -04:00
|
|
|
if (pagesz <= 0) {
|
2013-10-29 11:36:18 -04:00
|
|
|
pagesz = sysconf(_SC_PAGE_SIZE);
|
2013-10-29 11:44:25 -04:00
|
|
|
if (pagesz <= 0)
|
2014-02-27 10:08:17 -05:00
|
|
|
eprintf("can't determine pagesize\n");
|
2013-10-29 11:36:18 -04:00
|
|
|
}
|
|
|
|
printf("%ld\n", pagesz);
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|