Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264807AbTE1RKx (ORCPT ); Wed, 28 May 2003 13:10:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S264809AbTE1RKx (ORCPT ); Wed, 28 May 2003 13:10:53 -0400 Received: from bay-bridge.veritas.com ([143.127.3.10]:5554 "EHLO mtvmime03.VERITAS.COM") by vger.kernel.org with ESMTP id S264807AbTE1RKv (ORCPT ); Wed, 28 May 2003 13:10:51 -0400 Date: Wed, 28 May 2003 18:26:24 +0100 (BST) From: Hugh Dickins X-X-Sender: hugh@localhost.localdomain To: John M Collins cc: linux-kernel@vger.kernel.org Subject: Re: Question about memory-mapped files In-Reply-To: <3ED4E4BB.10806@xisl.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 735 Lines: 19 On Wed, 28 May 2003, John M Collins wrote: > > If I invoke mmap to map a file to memory, and it succeeds, can I safely > close the original file descriptor and rely on the memory still being > mapped and the file still updated (possibly with mysnc)? Yes, that's definitely a part of the specification of mmap, even if it's not mentioned on the man page. Note that the file on disk is likely not to be updated until some time after you unmap it, unless you use msync to force it. Hugh - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/