delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/27/06:06:53

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Tue, 27 Feb 2001 12:05:58 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: lseek() fails to seek on /dev/fd0 ('\\.\A:')
Message-ID: <20010227120558.E27406@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <u67ae79bw6v DOT fsf AT rachel DOT hq DOT vtech> <u671ysl8xda DOT fsf AT rachel DOT hq DOT vtech>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <u671ysl8xda.fsf@rachel.hq.vtech>; from jojo@virtutech.se on Mon, Feb 26, 2001 at 01:03:29PM +0100

On Mon, Feb 26, 2001 at 01:03:29PM +0100, Jesper Eskilson wrote:
> Jesper Eskilson <jojo AT virtutech DOT se> writes:
> 
> > Why is it ok to seek to 0 bytes and 1 byte, but not 2?
> 
> The test-program passed parameters in the wrong order, the correct order is
> 
>         lseek(fd, pos, whence)
> 
> However, this was not the error I was really trying to fix (the real
> program passed the parameters in the correct order). The real problem was
> that lseek() fails when doing SEEK_END on a raw device. On Linux and
> Solaris, lseek() return 0 when doing SEEK_END on raw devices.

I just checked on Linux. It returns 0 when offset is 0. otherwise
it returns -1. The difference between file and device is that the
return value is 0 on the raw drive and > 0 on the file. I could
check in an appropriate patch which is easy but I want to discuss
this on cygwin-patches first.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

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

- Raw text -


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