This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: lseek() fails to seek on /dev/fd0 ('\\.\A:')
- To: Jesper Eskilson <jojo at virtutech dot se>
- Subject: Re: lseek() fails to seek on /dev/fd0 ('\\.\A:')
- From: Egor Duda <deo at logos-m dot ru>
- Date: Mon, 26 Feb 2001 16:02:25 +0300
- CC: cygwin at cygwin dot com
- Organization: DEO
- References: <u67ae79bw6v.fsf@rachel.hq.vtech> <u671ysl8xda.fsf@rachel.hq.vtech>
- Reply-To: Egor Duda <cygwin at cygwin dot com>
Hi!
Monday, 26 February, 2001 Jesper Eskilson jojo@virtutech.se wrote:
JE> However, this was not the error I was really trying to fix (the real
JE> program passed the parameters in the correct order). The real problem was
JE> that lseek() fails when doing SEEK_END on a raw device. On Linux and
JE> Solaris, lseek() return 0 when doing SEEK_END on raw devices.
Single Unix Specification v2 states that "The behaviour of lseek() on
devices which are incapable of seeking is implementation-dependent.
The value of the file offset associated with such a device is
undefined." and
" The lseek() function will fail if:
...
[EINVAL]
The whence argument is not a proper value, or the resulting file offset
would be invalid.
...
"
Win32 API doesn't allow seeking from the end of floppy devices,
so i think it's pretty reasonable for cygwin to return -1
with errno==EINVAL in this case.
Anyway, if we decide to be linux- and solaris- compatible here, the
patch would be trivial.
Egor. mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple