Cygwin 1.7: O_DIRECT read from raw devices returns EOF

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Nov 21 15:59:00 GMT 2008


On Nov 21 13:58, Christian Franke wrote:
> void
> fhandler_dev_floppy::raw_read (void *ptr, size_t& ulen)
> {
> ...
>   DWORD bytes_to_read = 0;
> ...
>   if (devbuf)
>     { /* !O_DIRECT ... */ }
>   else
>     {
>       _off64_t current_position = get_current_position ();
>       if (current_position + bytes_to_read >= drive_size)
> 	bytes_to_read = drive_size - current_position;
>       if (bytes_to_read && !read_file (p, len, &bytes_read, &ret))
> ...
> 
> In the O_DIRECT case, bytes_to_read is always 0.

Indeed.  Thanks for catching this bug!  I've checked in a patch.
Would you mind to give it a whirl?


Thanks again,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

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



More information about the Cygwin mailing list