lseek() fails to seek on /dev/fd0 ('\\.\A:')

Corinna Vinschen cygwin@cygwin.com
Tue Feb 27 03:06:00 GMT 2001


On Mon, Feb 26, 2001 at 01:03:29PM +0100, Jesper Eskilson wrote:
> Jesper Eskilson <jojo@virtutech.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@cygwin.com
Red Hat, Inc.

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



More information about the Cygwin mailing list