diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-09-26 14:55:40 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-09-26 14:55:40 +0000 |
commit | b470a0e81fb3e56dfd7886e0099e7b6b7c148101 (patch) | |
tree | 75fc2d28a97ca8e2b1af8ab3431177d199343ebb /winsup/cygwin/fhandler.h | |
parent | d5f4ee62b706f7cfe22a92fd796dc36382690950 (diff) | |
download | cygnal-b470a0e81fb3e56dfd7886e0099e7b6b7c148101.tar.gz cygnal-b470a0e81fb3e56dfd7886e0099e7b6b7c148101.tar.bz2 cygnal-b470a0e81fb3e56dfd7886e0099e7b6b7c148101.zip |
* fhandler.h (class fhandler_dev_raw): Add drive information members
drive_size, current_position and bytes_per_sector.
(fhandler_dev_floppy::get_drive_info): Declare.
* fhandler_floppy.cc (fhandler_dev_floppy::is_eom): Define ERROR_SEEK
and ERROR_SECTOR_NOT_FOUND as end-of-medium conditions.
(fhandler_dev_floppy::get_drive_info): New method to have one function
retrieving drive info.
(fhandler_dev_floppy::open): Call get_drive_info to get drive
information right from the start.
(fhandler_dev_floppy::lseek): Use and set drive information members.
Especially keep track of current_position.
(fhandler_dev_floppy::ioctl): Ditto.
* fhandler_raw.cc (fhandler_dev_raw::write_file): Keep track of
current_position.
(fhandler_dev_raw::read_file): Ditto.
(fhandler_dev_raw::raw_read): Never try to read beyond end-of-medium.
(fhandler_dev_raw::dup): Handle new drive information members.
Diffstat (limited to 'winsup/cygwin/fhandler.h')
-rw-r--r-- | winsup/cygwin/fhandler.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler.h b/winsup/cygwin/fhandler.h index bdc73bfbf..ac1e4e9a9 100644 --- a/winsup/cygwin/fhandler.h +++ b/winsup/cygwin/fhandler.h @@ -551,6 +551,9 @@ public: class fhandler_dev_raw: public fhandler_base { protected: + _off64_t drive_size; + _off64_t current_position; + unsigned long bytes_per_sector; char *devbuf; size_t devbufsiz; size_t devbufstart; @@ -600,6 +603,9 @@ class fhandler_dev_raw: public fhandler_base class fhandler_dev_floppy: public fhandler_dev_raw { + private: + int fhandler_dev_floppy::get_drive_info (struct hd_geometry *geo); + protected: virtual int is_eom (int win_error); virtual int is_eof (int win_error); |