summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e72bd7)
raw | patch | inline | side by side (parent: 9e72bd7)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 18 May 2007 16:40:55 +0000 (16:40 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 18 May 2007 16:40:55 +0000 (16:40 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1066 a5681a0c-68f1-0310-ab6d-d61299d08faa
configure.ac | patch | blob | history | |
src/rrd_update.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 202f370a1994c714f8105907da4a063249c70093..df219553ac8f746bb4dfe3d2976eed1681310fbe 100644 (file)
--- a/configure.ac
+++ b/configure.ac
dnl for each function found we get a definition in config.h
dnl of the form HAVE_FUNCTION
-AC_CHECK_FUNCS(tzset mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday posix_fadvise)
+AC_CHECK_FUNCS(tzset mbstowcs opendir readdir chdir chroot getuid setlocale strerror strerror_r snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday posix_fadvise madvise)
if test "x$enable_mmap" = xyes; then
diff --git a/src/rrd_update.c b/src/rrd_update.c
index 5f27c2f966a66784e50bf5d1a7193f9177d3095e..608c3146c39b9ff1f9c4954c9e586c81c6715a21 100644 (file)
--- a/src/rrd_update.c
+++ b/src/rrd_update.c
@@ -427,7 +427,12 @@ _rrd_update(const char *filename, const char *tmplt, int argc, const char **argv
fclose(rrd_file);
return(-1);
}
+#ifdef HAVE_MADVISE
+ /* when we use mmaping we tell the kernel the mmap equivalent
+ of POSIX_FADV_RANDOM */
+ madvise(rrd_mmaped_file,rrd_filesize,MADV_RANDOM);
#endif
+#endif
/* loop through the arguments. */
for(arg_i=0; arg_i<argc;arg_i++) {
char *stepper = strdup(argv[arg_i]);