DISC(4) UNIX Programmer's Manual DISC(4) NAME disc - direct disc access HP-UX COMPATIBILITY Level: HP-UX/RUN ONLY Origin: HP DESCRIPTION This page describes the actions of the general HP-UX disc drivers when referring to a disc as either a blocked or unblocked (raw or character special) device. Block special files access discs via the system's normal buffering mechanism. Buffering is done in such a way that concurrent access through multiple opens or mounts of the same physical device do not get out of phase. Block special files may be read and written without regard to physical disc records. Each I/O operation results in one or more log- ical block (1K bytes) transactions. There is also a _r_a_w interface via a character special file which provides for direct transmission between the disc and the user's read or write buffer. A single read or write operation results in exactly one transaction. Therefore raw I/O is considerably more efficient when many bytes are transmitted in a single operation because blocked disc access requires potentially several transactions and does not transmit directly to user space. In raw I/O, there may be implementation dependent restric- tions on the alignment of the user buffer in memory. Also, each transfer must occur on a sector boundary and must read a whole number of sectors. The sector size is a hardware dependent value. Each raw access is independent of other raw accesses and of block accesses to the same physical device. Thus, transfers are not guaranteed to occur in any particular order. In both raw and blocked I/O, each operation is completed to the device before the call returns. In addition, blocked I/O potentially does a one (or more) block read-ahead. The name of a raw device (its character special file name) is typically the same as the name of the corresponding blocked device (its block special file name) prefixed with an "r". SEE ALSO intro(4), mkdev(8), mknod(8), and the _H_P-_U_X _S_y_s_t_e_m _A_d_m_i_n_i_s_- _t_r_a_t_o_r _M_a_n_u_a_l included with your system. Printed 12/17/84 1 DISC(4) UNIX Programmer's Manual DISC(4) WARNING On some systems, having both a mounted file system and a block special file open on the same device is asking for trouble; this should be avoided if possible. This is because it may be possible for some files to have private buffers in some systems. Like discs, the cartridge tape units in command set 80 disc drives are also accessed as blocked or raw devices. How- ever, using a cartridge tape as a file system will quickly destroy the tape drive. Printed 12/17/84 2