delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/01/18/10:44:20

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Mail-Handler: Dyn Standard SMTP by Dyn
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX19J2G4sZVRZRGvs8rFUYR/F
Date: Fri, 18 Jan 2013 10:43:52 -0500
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com, Chris Sutcliffe <ir0nh34d AT gmail DOT com>
Subject: Re: rtorrent and recent snapshots - apparent problem with msync()
Message-ID: <20130118154352.GA23471@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com, Chris Sutcliffe <ir0nh34d AT gmail DOT com>
References: <CAGHJv4fiyojmQGR_d4=Pv1q9dtJogbcfCKBj_LtWyYsLYOFBGQ AT mail DOT gmail DOT com> <20130117062415 DOT GB24529 AT ednor DOT casa DOT cgf DOT cx> <CAGHJv4cTsRD5km3oSmBy2BbWGTvL2mfbU9xRMPbnj2XCLN7HgQ AT mail DOT gmail DOT com> <CAGHJv4cAm+v_VuKXxjdriTN-d-AoQfengNEFY+MqZOAnOsH0-Q AT mail DOT gmail DOT com> <20130118003522 DOT GA1913 AT ednor DOT casa DOT cgf DOT cx> <20130118093205 DOT GB11791 AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
In-Reply-To: <20130118093205.GB11791@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Fri, Jan 18, 2013 at 10:32:05AM +0100, Corinna Vinschen wrote:
>On Jan 17 19:35, Christopher Faylor wrote:
>> And, Corinna, please if the change I made to your function is wrong or
>> you just don't like my variable names or comments please feel free to
>> expunge what I did with extreme prejudice.
>
>Looks good to me.  I'm just wondering.  I have a similar piece of code
>in the rename function in syscalls.cc, lines 2342ff.  This loop also
>allows signals to break the loop.  Maybe we should do the same here?
>
>I just read the Linux msync man page(*) as well as the MSDN
>FlushViewOfFile man page(**).  Looks like this function is missing a
>bit of functionality.  Right now msync only calls FlushViewOfFile.
>Per MSDN this is equivalent to msync called with the MS_ASYNC flag.
>If the MS_SYNC flag is given, the function should also call FlushFileBuffers.
>I'll fix that.
>
>Also, Linux msync is allowed to return with EBUSY if "MS_INVALIDATE was
>specified in flags, and a memory lock exists for the specified address
>range."  That seems to match our situation... except that rtorrent
>doesn't use the MS_INVALIDATE flag.  Either way, maybe we should
>translate ERROR_LOCK_VIOLATION to EBUSY?
>
>(*)  http://www.kernel.org/doc/man-pages/online/pages/man2/msync.2.html
>(**) http://msdn.microsoft.com/en-us/library/windows/desktop/aa366563%28v=vs.85%29.aspx

That sounds right to me.  EACCES didn't seem like the right translation
here.

>> I can't explain what in the newer snapshots would cause a difference
>> in behavior other than the fact that they were being built with a
>> newer compiler and a revamped configure script.
>
>I tried with my gcc 4.5.3 build and I can't reproduce the problem.
>Still, it's just calls to OS functions.  There should be no compiler
>induced difference in the error values returned from OS functions.
>Except your gcc produces faster code than WIndows allows ;)

Yeah, my compiler setup is great.  Now if I could just use it to compile
my packages, I'd be very happy.  So far it only seems to work right with
Cygwin.  Other stuff, like gdb and binutils are currently problematic.

I saw that you made another change to this function.  Is it possible that
this might actually fix the "rtorrent problem"?

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019