DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

write(D2oddi)


write -- write data character-by-character

Synopsis

   void prefixwrite (dev_t dev);

Description

The write( ) entry point initiates and supervises a data transfer from the user data area to a device for raw or character I/O operations.

Arguments


dev
device number

Return values

None

Usage

Drivers for low-speed character devices typically use the clist data structure and the TTY subsystem to perform buffering. Drivers for high-speed character devices such as network interface boards generally set up their own buffering schemes.

Raw I/O for block devices

Block drivers usually include a write( ) routine to support raw I/O to the device. The logic is:

  1. Extract the minor device number for use by physio(D3oddi) when performing physical I/O.

  2. Check the minor device number against the information in the scsi_dev_cfg(D4osdi) configuration table. If it is improper, use the cmn_err(D3oddi) function to issue an error message, set u.u_error to ENODEV, and return.

  3. For disk devices, get the size of the device from a local driver array of disk sizes.

  4. Call physck(D3oddi) to ensure that the I/O is correct for the device size.

  5. Call physio(D3oddi). This routine calls xxbreakup which then calls the strategy(D2oddi) routine to perform the raw I/O.

Context and synchronization

User context. The driver can block and can do operations such as copyout(D3) that require access to the requesting process's user-level address space.

Hardware applicability

All

Version applicability

oddi: 1, 2, 2mp, 3, 3mp, 4, 4mp, 5, 5mp, 6, 6mp

SVR5 DDI compatibility

DDI versions prior to version 7 provide similar functionality through the write(D2) entry point routine. DDI 8 drivers use the biostart(D2) entry point instead.

External dependencies

Drivers that contain a write( ) routine must have a w in the second column of the mdevice(F) file.

References

read(D2oddi), strategy(D2oddi)


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005