summaryrefslogtreecommitdiff
path: root/usr.bin/cmp
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2003-11-21 21:41:39 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2003-11-21 21:41:39 +0000
commitc87ab46eedc2039bba88e3e81f6bfd2620a03515 (patch)
tree9c90708ece6078468f18ac155d7b38dd80cde444 /usr.bin/cmp
parente3a7340c3aa111b73910da8aa88d51d3f11a48fa (diff)
mark mmap()ed memory as sequentially accessed
Diffstat (limited to 'usr.bin/cmp')
-rw-r--r--usr.bin/cmp/regular.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/cmp/regular.c b/usr.bin/cmp/regular.c
index f5fe302456f..3056b0eaa2d 100644
--- a/usr.bin/cmp/regular.c
+++ b/usr.bin/cmp/regular.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: regular.c,v 1.7 2003/06/03 02:56:06 millert Exp $ */
+/* $OpenBSD: regular.c,v 1.8 2003/11/21 21:41:38 mickey Exp $ */
/* $NetBSD: regular.c,v 1.2 1995/09/08 03:22:59 tls Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: regular.c,v 1.7 2003/06/03 02:56:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: regular.c,v 1.8 2003/11/21 21:41:38 mickey Exp $";
#endif
#endif /* not lint */
@@ -85,6 +85,10 @@ c_regular(fd1, file1, skip1, len1, fd2, file2, skip2, len2)
munmap(p1, (size_t)length);
goto mmap_failed;
}
+ if (length) {
+ madvise(p1, length, MADV_SEQUENTIAL);
+ madvise(p2, length, MADV_SEQUENTIAL);
+ }
dfound = 0;
for (byte = line = 1; length--; ++p1, ++p2, ++byte) {