delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/03/01/20:38:35

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Originating-IP: [210.84.179.8]
X-Originating-Email: [jasonwinter AT hotmail DOT com]
X-Sender: jasonwinter AT hotmail DOT com
From: "Jason Winter" <jasonwinter AT hotmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Fix for : read()
Date: Tue, 02 Mar 2004 01:38:16 +0000
Mime-Version: 1.0
Message-ID: <Sea2-F24gDuDgThPOhj000423db@hotmail.com>
X-OriginalArrivalTime: 02 Mar 2004 01:38:16.0824 (UTC) FILETIME=[08ECAF80:01C3FFF7]

Hi Corinna,

(For continued reference:)
>The Tape Block Length information is in MSDN, within the document Q161338 
>in the
>knowledge base.

The CygWin read() function calls ReadFile() repeatedly while the programmers 
read buffer-length parameter value "#of bytes" hasn't been read from the 
handle.  Under Unix, low-level IO read() doesn't always return 100 bytes in 
this call:

rc = read (h, buf, 100);

In fact, if h refers to a tape, which also has a vaiable-block of data ready 
to be read at the current tape position..  You may only get, say, 80 bytes 
returned if it's a 80 byte block record.  In CygWin, since it continues to 
call ReadFile() in the cygwin1.dll read() function, the programmer, me 
actually, loses all record of the tapes original data-block-length - with 
CygWin read() you might think the block was 100 bytes long - having started 
to read the next block on the tape.  (20 bytes of it in this example.)

Jason.

_________________________________________________________________
SEEK: Now with over 50,000 dream jobs! Click here  
http://ninemsn.seek.com.au/


--
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