From owner-freebsd-hackers Fri Jun 16 7:18:24 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from arjun.niksun.com (gwnew.niksun.com [206.20.52.130]) by hub.freebsd.org (Postfix) with ESMTP id 9DC9D37B55E for ; Fri, 16 Jun 2000 07:18:20 -0700 (PDT) (envelope-from joy@niksun.com) Received: from falcon.niksun.com (falcon.niksun.com [10.0.0.167]) by arjun.niksun.com (8.9.3/8.9.3) with ESMTP id KAA75553 for ; Fri, 16 Jun 2000 10:18:13 -0400 (EDT) (envelope-from joy@falcon.niksun.com) Message-ID: <394A3727.1FEC441E@falcon.niksun.com> Date: Fri, 16 Jun 2000 14:18:15 +0000 From: Joy Ganguly X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 3.2-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers Subject: mmap and file writes...??? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi all, i have a question regarding mmap and file write. a file is mmap'ed and data is written into the mapped region. now the same region is written. (as shown below) buf = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); . . /* some data put in buf */ . write(fd, buf, len); now does this lead to unnecessary copies?? more specifically what happens if two virtual addresses point to the same physical address and data is copied from one to the other. thanx in advance joy To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message