From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1171FBB9C for ; Wed, 14 Sep 2005 16:07:35 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8EE7YXV029024 for ; Wed, 14 Sep 2005 16:07:34 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA02774 for ; Wed, 14 Sep 2005 16:07:34 +0200 (MET DST) Received: from mallaury.nerim.net (smtp-103-wednesday.noc.nerim.net [62.4.17.103]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j8EE7XHh029019 for ; Wed, 14 Sep 2005 16:07:33 +0200 Received: from karryall.dnsalias.org (karryall.dnsalias.org [213.41.180.99]) by mallaury.nerim.net (Postfix) with ESMTP id 8E7884F40F; Wed, 14 Sep 2005 16:07:24 +0200 (CEST) Received: by karryall.dnsalias.org (Postfix, from userid 500) id 3E0EA596F70; Wed, 14 Sep 2005 16:07:33 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17192.11940.997486.960780@karryall.dnsalias.org> Date: Wed, 14 Sep 2005 16:07:32 +0200 From: Olivier Andrieu To: "Bauer, Christoph" Cc: caml-list@inria.fr Subject: Re: [Caml-list] Bigarray.*.map_file In-Reply-To: <26EB47FDD566A7469FC862DAF373792F07D5E0@kaiserslautern1.lmsintl.com> References: <26EB47FDD566A7469FC862DAF373792F07D5E0@kaiserslautern1.lmsintl.com> X-Mailer: VM 7.19 under Emacs 21.4.1 X-Miltered: at concorde with ID 43282EA6.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43282EA5.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; andrieu:01 andrieu:01 ijm:01 caml-list:01 bigarray:01 bigarray:01 genarray:01 lseek:01 otherlibs:01 mappings:01 unix:01 unix:01 jussieu:01 descriptor:02 parameter:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=RCVD_IN_BL_SPAMCOP_NET autolearn=disabled version=3.0.3 Hi, Bauer, Christoph [Wednesday 14 September 2005] : > Bigarray.Genarray.map_file uses mmap to "read" a file. How can > I specify an offset in the file (like the offset parameter in mmap)? > Unix.lseek doesn't help me. You can't: mmap is called with offset 0 (see otherlibs/bigarray/mmap_unix.c). > How can I do an munmap? I ask because of these lines from the man-page: > > The munmap system call deletes the mappings for the speci- > fied address range, and causes further references to > addresses within the range to generate invalid memory ref- > erences. The region is also automatically unmapped when > the process is terminated. On the other hand, closing the > file descriptor does not unmap the region. unmap() is called when the bigarray is collected by the GC. -- Olivier