* errno.cc (errmap): Map ERROR_SHARING_VIOLATION to EBUSY,

ERROR_EOM_OVERFLOW and ERROR_NO_DATA_DETECTED to EIO.  Add mappings
	for ERROR_NO_MEDIA_IN_DRIVE, ERROR_DEVICE_REQUIRES_CLEANING and
	ERROR_DEVICE_DOOR_OPEN.
	* fhandler.h (class fhandler_dev_raw): Drop varblkop member.
	(fhandler_dev_raw::is_eom): De-virtualize.
	(fhandler_dev_raw::is_eof): Ditto.
	(class fhandler_dev_tape): Drop lasterr and dp member.  Add mt_mtx
	member.  Drop all private methods formerly used by ioctl.
	(fhandler_dev_tape::is_rewind_device): Use get_minor for clarity.
	(fhandler_dev_tape::driveno): New method.
	(fhandler_dev_tape::drive_init): New method.
	(fhandler_dev_tape::clear): Remove method.
	(fhandler_dev_tape::is_eom): Ditto.
	(fhandler_dev_tape::is_eof): Ditto.
	(fhandler_dev_tape::write_file): Ditto.
	(fhandler_dev_tape::read_file): Ditto.
	(fhandler_dev_tape::_lock): New method.
	(fhandler_dev_tape::unlock): New method.
	(fhandler_dev_tape::raw_read): New method.
	(fhandler_dev_tape::raw_write): New method.
	* fhandler_raw.cc (fhandler_dev_raw::is_eom): New method.
	(fhandler_dev_raw::is_eof): New method.
	(fhandler_dev_raw::open): Allow setting write through option by
	using the O_TEXT flag as ... flag.
	(fhandler_dev_raw::writebuf): Remove usage of varblkop and other
	tape specific code.
	(fhandler_dev_raw::raw_read): Ditto.
	(fhandler_dev_raw::dup): Ditto.
	* fhandler_tape.cc: Rewrite tape operations entirely.  Implement
	new tape driver classes mtinfo, mtinfo_drive and mtinfo_part.
	Reduce fhandler_dev_tape methods to mostly just calling appropriate
	mtinfo_drive methods.
	(mtinfo_init): New function adding the mtinfo shared memory area.
	* mtinfo.h: New file, containing the definition of the new tape
	driver classes.
	* shared.cc: Include mtinfo.h.
	(offsets): Add entry for mtinfo shared memory area.
	(memory_init): Call mtinfo_init.
	* shared_info.h (shared_locations): Add SH_MTINFO shared location.
	* include/cygwin/mtio.h: Change and add various comments.  Add GMT_xxx
	macros for new generic flags.  Add MT_ST_xxx bitfield definitions
	for MTSETDRVBUFFER ioctl.
	* include/cygwin/version.h: Bump API minor version number.
This commit is contained in:
Corinna Vinschen
2004-03-26 21:43:49 +00:00
parent 359b6e4c49
commit dee563095d
10 changed files with 1460 additions and 630 deletions

View File

@ -48,7 +48,7 @@ static NO_COPY struct
X (NO_MORE_FILES, ENMFILE),
X (WRITE_PROTECT, EROFS),
X (BAD_UNIT, ENODEV),
X (SHARING_VIOLATION, EACCES),
X (SHARING_VIOLATION, EBUSY),
X (LOCK_VIOLATION, EACCES),
X (SHARING_BUFFER_EXCEEDED, ENOLCK),
X (HANDLE_EOF, ENODATA),
@ -101,10 +101,10 @@ static NO_COPY struct
X (IO_DEVICE, EIO),
X (NOT_OWNER, EPERM),
X (END_OF_MEDIA, ENOSPC),
X (EOM_OVERFLOW, ENOSPC),
X (EOM_OVERFLOW, EIO),
X (BEGINNING_OF_MEDIA, EIO),
X (SETMARK_DETECTED, EIO),
X (NO_DATA_DETECTED, ENOSPC),
X (NO_DATA_DETECTED, EIO),
X (POSSIBLE_DEADLOCK, EDEADLOCK),
X (CRC, EIO),
X (NEGATIVE_SEEK, EINVAL),
@ -116,6 +116,9 @@ static NO_COPY struct
X (INVALID_BLOCK_LENGTH, EIO),
X (BUS_RESET, EIO),
X (FILEMARK_DETECTED, EIO),
X (NO_MEDIA_IN_DRIVE, ENOMEDIUM),
X (DEVICE_REQUIRES_CLEANING, EIO),
X (DEVICE_DOOR_OPEN, EIO),
{ 0, NULL, 0}
};