Provides access to the read/write optical device driver.
The omd special file provides block and character (raw) access to disks in the read/write optical drive.
The r prefix on a special file name means that the drive is accessed as a raw device rather than a block device. Performing raw I/O with an optical disk requires that all data transfers be in multiples of the optical-disk logical block length. Also, all lseek subroutines that are made to the raw read/write optical device driver must set the file offset pointer to a value that is a multiple of the specified logical block size.
The scdisk SCSI Device Driver provides more information about implementation specifics.
Read/write optical disks, used in read/write optical drives, are media that provide storage for large amounts of data. Block access to optical disks is achieved through the special files /dev/omd0, /dev/omd1, ... /dev/omdn. Character access is provided through the special files /dev/romd0, /dev/romd1, ... /dev/romdn.
When a read/write optical disk is ejected from the drive for a mounted read/write optical file system, the files on the optical disk can no longer be accessed. Before attempting to access these files again, perform the following steps for a file system mounted from the read/write optical disk:
If these actions do not work, perform a forced unmount of the file system; then, remount the file system.
Most read/write optical operations are implemented using the open, read, write, and close subroutines. However, for some purposes, use of the openx (extended) subroutine is required.
The openx subroutine is supported to provide additional functions to the open sequence. Appropriate authority is required for execution. If an attempt is made to run the openx subroutine without the proper authority, the subroutine returns a value of -1 and sets the errno global variable to a value of EPERM.
The ioctl subroutine IOCINFO operation returns the devinfo structure defined in the /usr/include/sys/devinfo.h file. The IOCINFO operation is the only operation defined for all device drivers that use the ioctl subroutine. Other ioctl operations are specific for the type of device driver. Diagnostic mode is not required for the IOCINFO operation.
Possible errno values for ioctl, open, read, and write subroutines when using the omd special file include:
EACCES | Indicates one of the following circumstances:
|
EBUSY | Indicates one of the following circumstances:
|
EFAULT | Indicates an illegal user address. |
EFORMAT | Indicates the target device has unformatted media or media in an incompatible format. |
EINVAL | Indicates one of the following circumstances:
|
EIO | Indicates one of the following circumstances:
|
EMEDIA | Indicates one of the following circumstances:
|
EMFILE | Indicates an open operation was attempted for an adapter that already has the maximum permissible number of opened devices. |
ENODEV | Indicates one of the following circumstances:
|
ENOTREADY | Indicates no read/write optical disk is in the drive. |
ENXIO | Indicates one of the following circumstances:
|
EPERM | Indicates the attempted subroutine requires appropriate authority. |
ESTALE | Indicates a read-only optical disk was ejected (without first being closed by the user) and then either reinserted or replaced with a second disk. |
ETIMEDOUT | Indicates an I/O operation has exceeded the given timer value. |
EWRPROTECT | Indicates one of the following circumstances:
|
/dev/romd0, /dev/romd1,..., /dev/romdn | Provides character access to the read/write optical device driver. |
/dev/omd0, /dev/omd1,..., /dev/omdn | Provides block access to the read/write optical device driver. |
The close subroutine, ioctl subroutine, lseek subroutine, open subroutine, read subroutine, write subroutine.