www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/09/04/13:36:09

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: Re: Changes to winsup-980812, again, some more...
4 Sep 1998 13:36:09 -0700 :
Message-ID: <35F04944.6FBC42AF.cygnus.cygwin32.developers@cityweb.de>
References: <01BDD7DB DOT CAD26E40 AT sos>
Mime-Version: 1.0
To: Sergey Okhapkin <sos AT prospect DOT com DOT ru>, cygwin32-developers AT cygnus DOT com

Sergey Okhapkin wrote:
> 
> Did you try to write a multi-volume tar floppies? That didn't work before.
> 

No, I haven't tested this 'til today.

It doesn't work, because WinNT returns ERROR_INVALID_PARAMETER,
if you read over the last block of a raw device. Gaga, isn't it?

I have tested it on tape device, and, as expected, it doesn't
operate, too :-( First, fhandler_dev_tape has it's own methods
`raw_read()' and `raw_write()' and second, the error codes
are not the same. This would be too simple, woudn't it, Bill?

I will work on a correct solution, including tapes, but for
today a first hack for raw devices such as floppies (not for
tapes!):

------- snip ---------
*** fhandler.cc.orig   Fri Sep 04 21:58:18 1998
--- fhandler.cc Fri Sep 04 21:58:48 1998
*************** fhandler_base::raw_read (void *ptr, size
*** 176,181 ****
--- 176,186 ----
        case ERROR_MORE_DATA:
          /* `bytes_read' is supposedly valid.  */
          break;
+       case ERROR_INVALID_PARAMETER:
+         /* Temporary hack for raw devices. */
+         set_errno (ENOSPC);
+         return -1;
+         break;
        default:
          syscall_printf ("ReadFile %s failed with error %d\n",
                          unix_path_name_,
------- snip ---------

Bye,
Corinna

- Raw text -


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