Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/cp Use madvise(2) after mmap(2) in case "VM_AND_BUFFER_C...



details:   https://anonhg.NetBSD.org/src/rev/27c79e8693c5
branches:  trunk
changeset: 512848:27c79e8693c5
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Jul 18 11:01:54 2001 +0000

description:
Use madvise(2) after mmap(2) in case "VM_AND_BUFFER_CACHE_SYNCHRONIZED"
is defined which it is not right now.

diffstat:

 bin/cp/utils.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 37054d4e42f9 -r 27c79e8693c5 bin/cp/utils.c
--- a/bin/cp/utils.c    Wed Jul 18 10:39:28 2001 +0000
+++ b/bin/cp/utils.c    Wed Jul 18 11:01:54 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: utils.c,v 1.17 1999/03/01 18:57:29 mjl Exp $   */
+/*     $NetBSD: utils.c,v 1.18 2001/07/18 11:01:54 tron Exp $  */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c    8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.17 1999/03/01 18:57:29 mjl Exp $");
+__RCSID("$NetBSD: utils.c,v 1.18 2001/07/18 11:01:54 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -154,6 +154,7 @@
                                warn("%s", entp->fts_path);
                                rval = 1;
                        } else {
+                               (void) madvise(p, (size_t)fs->st_size, MADV_SEQUENTIAL);
                                if (write(to_fd, p, fs->st_size) != fs->st_size) {
                                        warn("%s", to.p_path);
                                        rval = 1;



Home | Main Index | Thread Index | Old Index