delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/12/09/19:49:33

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Date: Thu, 9 Dec 2004 19:49:18 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Peter Astrand <astrand AT lysator DOT liu DOT se>
cc: cygwin AT cygwin DOT com
Subject: Re: short fread(), but no ferror/feof
In-Reply-To: <Pine.GSO.4.51L2.0412092344001.4112@koeberg.lysator.liu.se>
Message-ID: <Pine.GSO.4.61.0412091946260.19749@slinky.cs.nyu.edu>
References: <Pine DOT GSO DOT 4 DOT 51L2 DOT 0412051701370 DOT 21199 AT koeberg DOT lysator DOT liu DOT se> <Pine DOT GSO DOT 4 DOT 51L2 DOT 0412092344001 DOT 4112 AT koeberg DOT lysator DOT liu DOT se>
MIME-Version: 1.0

On Fri, 10 Dec 2004, Peter Astrand wrote:

> >> I've discovered that fread(ptr, size, nitems, stream) sometimes returns a
> >> value less than "nitems", but does not set feof() nor ferror(). As I
>
> >A simple, compilable test case with results shown on both linux and
> >cygwin would prove your theory.
>
> Here you go; example follows. Test run on Linux:
>
> ---
> Got 66 bytes:
> /bin/ls: /somebogus: Filen eller katalogen finns inte
> /etc/passwd
> |EOF has been reached.
> ---
>
> Test run on Cygwin:
>
> ---
> $ ./a.exe
> Got 9 bytes:
> /bin/ls: |
> ---
>
> As you can see, the result is partial, and there is no EOF nor error.
>
> I guess this is the problem described at
> http://sources.redhat.com/ml/newlib/2004/msg00477.html. Perhaps you can
> apply the suggested patch?

According to <http://sources.redhat.com/ml/newlib/2004/msg00478.html>, the
patch was checked in on Oct 26.  Cygwin uses the latest version of newlib.
Cygwin 1.5.12-1 was released on Nov 10, so it should contain this patch.

You can verify this by downloading the Cygwin source package, and looking
at newlib/libc/stdio/fread.c.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT

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

- Raw text -


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