chiark / gitweb /
Working on debianisation and packaging.
[chiark-utils.git] / backup / readbuffer.c
index ec03c6a390a08022529e12d3727b287e3327718b..f389a77c3fce8bf6319bc4a2c6698dfe28e68dc9 100644 (file)
 
 #include <sys/time.h>
 #include <sys/types.h>
+#include <sys/mman.h>
 #include <assert.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <errno.h>
 #include <unistd.h>
 
-#define BUFFER 16*1024*1024
+#ifndef RWBUFFER_SIZE_MB
+#define RWBUFFER_SIZE_MB 16
+#endif
+
+#define BUFFER (RWBUFFER_SIZE_MB*1024*1024)
 #define WAITEMPTY ((BUFFER*1)/4)
 
 static inline int min(int a, int b) { return a<=b ? a : b; }