From owner-freebsd-hackers Fri Oct 27 14:18:19 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id OAA21587 for hackers-outgoing; Fri, 27 Oct 1995 14:18:19 -0700 Received: from freebie.polstra.com (freebie.polstra.com [198.211.214.7]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id OAA21575 for ; Fri, 27 Oct 1995 14:18:12 -0700 Received: from freebie.polstra.com (jdp@localhost) by freebie.polstra.com (8.6.11/8.6.9) with ESMTP id OAA07337 for ; Fri, 27 Oct 1995 14:18:03 -0700 Message-Id: <199510272118.OAA07337@freebie.polstra.com> X-Mailer: exmh version 1.6.4 10/10/95 To: freebsd-hackers@freebsd.org Subject: What does MAP_COPY do? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 27 Oct 1995 14:18:02 -0700 From: John Polstra Sender: owner-hackers@freebsd.org Precedence: bulk Could somebody please explain to me what mmap(2) does when the flag MAP_COPY is passed to it? The only documentation I can find is a comment in /usr/include/sys/mman.h: #define MAP_COPY 0x0004 /* "copy" region at mmap time */ It sounds like this means that a private copy is immediately made of the region. I.e., if two processes map the same file, each with MAP_COPY, they will get completely separate copies of the data. Is that right? Is the actual data copied, or just the page table entries? The only reason I can think of that this behavior would be desired would be as a work-around for a non-working copy-on-write implementation. Is that what it's for? Thanks -- enquiring minds gotta know. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Self-knowledge is always bad news." -- John Barth