Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@sourceware.cygnus.com>
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
From: Chris Faylor <cgf@cygnus.com>
Date: Thu, 21 Oct 1999 10:54:33 -0400
To: Earnie Boyd <earnie_boyd@yahoo.com>
Cc: Steve Jorgensen <steve@khoral.com>, cygwin@sourceware.cygnus.com
Subject: Re: Mmap problem
Message-ID: <19991021105433.A4912@cygnus.com>
Reply-To: cygwin@sourceware.cygnus.com
Mail-Followup-To: Earnie Boyd <earnie_boyd@yahoo.com>,
	Steve Jorgensen <steve@khoral.com>, cygwin@sourceware.cygnus.com
References: <19991021120802.18332.rocketmail@web117.yahoomail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 0.95.6i
In-Reply-To: <19991021120802.18332.rocketmail@web117.yahoomail.com>; from Earnie Boyd on Thu, Oct 21, 1999 at 05:08:02AM -0700

On Thu, Oct 21, 1999 at 05:08:02AM -0700, Earnie Boyd wrote:
>--- Steve Jorgensen <steve@khoral.com> wrote:
>> 
>>I'm trying to port Khoros Pro 2001 to NT using cygwin, and am having a
>>problem with the mmap call.
>>
>>Khoros has a transport abstraction that makes using mmap, tcpip, file,
>>pipes, or memory all look like a standard unix file, allowing users to
>>use our k* file i/o calls to read and write to each different kind of
>>transport.  Anyway, the mmap transport, in order to avoid excessive
>>resizing, forces the underlying mmap'ed file to grow more than the
>>write call needs.  At close time, we ftruncate the file back to the
>>size it's supposed to be.  The problem is that ftruncate is returning
>>with an access error.  This works on all the unix systems we've ported
>>to.
>>
>>I've tried the ftruncate both before and after the munmap call with the
>>same results.  Any ideas what else I can try, or am I just out of luck?
>
>This is an issue with the underlying file system.  Assuming that it can
>be done, you must have all accesses to the file closed.  Win32 will not
>allow such changes to an open file, even if you are the one that has it
>open.  I think I remember that there is coding in cygwin to queue
>operations on a file that fail due to an open fd to the file, so this
>could be a bug in that related coding.

There is a queue but it is applicable only to unlinking files.

-chris

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

