wip
[henge/apc.git] / src / apc.c
index cea3847..3b5774f 100644 (file)
--- a/src/apc.c
+++ b/src/apc.c
 #include <string.h> //strndupa
 /* Posix */
 #include <stdlib.h> //exit
-#include <unistd.h> //getopt
+#include <unistd.h> //getopt, sysconf
 /* Internal */
 #include "parser.tab.h" //bison
 
+#define DEFAULT_PAGESIZE 4096
 const char* cargs['Z'] = {0};
+const long  sys_pagesize;
 
 int main(int, char*[]);
 
@@ -76,6 +78,8 @@ int main
       printf(USAGE_LONG);
       exit(EXIT_SUCCESS);
   }
+  if ((sys_pagesize = sysconf(_SC_PAGESIZE)) == 0)
+    sys_pagesize = DEFAULT_PAGESIZE;
   if (lexer_init() || ir_init())
     { perror("init");
       exit(EXIT_FAILURE);