Provides raw I/O access to the physical volumes (fixed-disk) device driver.
The rhdisk special file provides raw I/O access and control functions to physical-disk device drivers for physical disks. Raw I/O access is provided through the /dev/rhdisk0, /dev/rhdisk1, ..., character special files.
Direct access to physical disks through block special files should be avoided. Such access can impair performance and also cause data consistency problems between data in the block I/O buffer cache and data in system pages. The /dev/hdisk block special files are reserved for system use in managing file systems, paging devices and logical volumes.
The r prefix on the special file name indicates that the drive is to be accessed as a raw device rather than a block device. Performing raw I/O with a fixed disk requires that all data transfers be in multiples of the disk block size. Also, all lseek subroutines that are made to the raw disk device driver must result in a file-pointer value that is a multiple of the disk-block size.
Attention: Data corruption, loss of data, or loss of system integrity (system crashes) will occur if devices supporting paging, logical volumes, or mounted file systems are accessed using block special files. Block special files are provided for logical volumes and disk devices on the operating system and are solely for system use in managing file systems, paging devices, and logical volumes. They should not be used for other purposes.
The openx subroutine provides additional functions to the open sequence. This subroutine requires appropriate permission to execute. Attempting to do so without the proper permission results in a return value of -1, with the errno global variable set to EPERM.
The readx and writex subroutines provide for additional parameters affecting the raw data transfer. The ext parameter specifies certain options that apply to the request being made. The options are constructed by logically ORing zero or more of the following values.
Note: The following operations can be used only with the writex subroutine.
Only one ioctl operation, IOCINFO, is defined for all device drivers that use the ioctl subroutine. The remaining ioctl operations are all specific to physical-disk devices. Diagnostic mode is not required for the IOCINFO operation.
The IOCINFO ioctl operation returns a structure for a device type of DD_DISK. This structure is defined in the /usr/include/sys/devinfo.h file.
In addition to the errors listed
for the ioctl, open, read, and
write subroutines, the following other error codes are also
possible:
The rhdisk special file is part of Base Operating System (BOS) Runtime.
/dev/hdisk0, /dev/hdisk1, ... /dev/hdiskn | Provide block I/O access to the physical volumes (fixed-disk) device driver. |
The close subroutine, ioctl subroutine, lseek subroutine, open subroutine, read subroutine, write subroutine.
Direct Access Storage Device (DASD) Overview in AIX 5L Version 5.1 Kernel Extensions and Device Support Programming Concepts.
SCSI Subsystem Overview in AIX 5L Version 5.1 Kernel Extensions and Device Support Programming Concepts.
scdisk SCSI Device Driver in AIX 5L Version 5.1 Technical Reference: Kernel and Subsystems Volume 1.
Serial DASD Subsystem Device Driver in AIX 5L Version 5.1 Technical Reference: Kernel and Subsystems Volume 1.