This is the mail archive of the cygwin-patches@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


On Tue, Feb 27, 2001 at 04:04:30PM +0300, Egor Duda wrote:
> CV> I have just checked on Linux kernel 2.2.x. For some reason it returns
> CV> the following on partitions and physical drives:
> 
> CV> lseek (fd, 0, SEEK_END) = 0 and the file pointer is set to the
> CV> beginning(!) of the raw device.
> 
> CV> lseek (fd, pos != 0, SEEK_END) = -1 (EINVAL)
> 
> CV> So if we want to be Linux compatible we could make our life very easy.
> 
> CV> Has somebody a 2.4 kernel to test the behaviour there?
> 
> i've just tested it under 2.4.0. it seeks correctly from the end of device
> and returns device_size + offset.
> 
>  if  return  value > 2G, it returns -1 with EOVERFLOW. I feel EFBIG is
> more appropriate here, but it's arguable.

Ok, that sounds more reasonable than the 2.2 behaviour. Would you
mind to change your current patch to work on physical drives
using IOCTL_DISK_GET_DRIVE_GEOMETRY and on partitions using the
IOCTL_DISK_GET_PARTITION_INFO call and, hmm, I think you're right,
to return EFBIG in the above case? That would be nice. I would
like to see the patch first but I'm pretty sure I will approve it.

BTW: I think we should begin to implement one or two 64bit calls
soon. At least `lseek64' would make much sense, IMO, and shouldn't
be too hard to implement.

Corinna

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]