Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
To: cygwin@cygwin.com
Subject: Re: read() returns errno == 1 ("Resource temporarily unavailable")
References: <u67snmf5x29.fsf@rachel.hq.vtech>
	<20010119120952.A7227@redhat.com> <u67vgrb4bod.fsf@rachel.hq.vtech>
	<20010119143246.F7746@redhat.com>
From: Jesper Eskilson <jojo@virtutech.se>
Organization: Virtutech AB
Date: 27 Jan 2001 17:24:22 +0100
In-Reply-To: Christopher Faylor's message of "Fri, 19 Jan 2001 14:32:47 -0500"
Message-ID: <u67wvbhnetl.fsf@rachel.hq.vtech>
Lines: 35
User-Agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.2 (Millennium)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Christopher Faylor <cgf@redhat.com> writes:

> On Fri, Jan 19, 2001 at 07:52:18PM +0100, Jesper Eskilson wrote:
> >Christopher Faylor <cygwin@cygwin.com> writes:
> >
> >> errno == 1 is not EAGAIN.  I assume that you mean errno == 11.
> >
> >Of course. My fingers slipped.
> >
> >> Looking at the code for _read, the only time this should be returned is if
> >> you are using a non-blocking read.
> >
> >I'm fairly certain that I'm not.
> 
> Well, since I'm fairly certain that the code is pretty clear and since I
> don't recall anyone else reporting this you're either going to have to
> debug this yourself or provide a very simple test case.

I finally gained some wisdom regarding this. The problem was caused when
accessing a file on a filesystem mounted in text-mode (the file-system was
accesses as //<driveletter>/<path>). By explicitly opening the file with
the O_BINARY flag, the problem went away. I thought I read the section on
text vs. binary files in the manual, but apparently I missed the section on
what happens with "//<driveletter>/".

Now, as I don't like leaving bugs behind without fully understanding why
they disappeared, the natural question is: Since the file-descriptor was
not in non-blocking mode, why did read() return EAGAIN not an EOF?

/Jesper
-- 
-------------------------------------------------------------------------
Jesper Eskilson                                         jojo@virtutech.se
Virtutech                                         http://www.virtutech.se
-------------------------------------------------------------------------


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

