1
0
mirror of git://git.suckless.org/ubase synced 2024-12-25 16:12:34 +00:00
ubase/pagesize.c

33 lines
484 B
C
Raw Normal View History

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