physio man page on OpenBSD

Man page or keyword search:  
man Server   11362 pages
apropos Keyword Search (all sections)
Output format
OpenBSD logo
[printable version]

PHYSIO(9)		     OpenBSD Kernel Manual		     PHYSIO(9)

NAME
     physio - initiate I/O on raw devices

SYNOPSIS
     int
     physio(void (*strategy)(struct buf *), dev_t dev, int flags, void
     (*minphys)(struct buf *), struct uio *uio);

DESCRIPTION
     physio() is a helper function typically called from character device read
     and write routines to start I/O on a user process buffer.	It calls back
     on the provided strategy routine one or more times to complete the
     transfer described by uio.	 The maximum amount of data to transfer with
     each call to strategy is determined by the minphys routine.  Since uio
     normally describes user space addresses, physio() needs to lock the
     appropriate data area into memory before each transaction with strategy
     (see the uvm_vslock() and uvm_vsunlock() functions in uvm(9)).  physio()
     always awaits the completion of the entire requested transfer before
     returning, unless an error condition is detected earlier.

     In all cases, a temporary buffer is allocated from a system pool.	This
     buffer will have the B_BUSY, B_PHYS, and B_RAW flags set when passed to
     the strategy routine.

     A break-down of the arguments follows:

     strategy
	     The device strategy routine to call for each chunk of data to
	     initiate device I/O.

     dev     The device number identifying the device to interact with.

     flags   Direction of transfer; the only valid settings are B_READ or
	     B_WRITE.

     minphys
	     A device specific routine called to determine the maximum
	     transfer size that the device's strategy routine can handle.

     uio     The description of the entire transfer as requested by the user
	     process.  Currently, the results of passing a uio structure with
	     the `uio_segflg' set to anything other than UIO_USERSPACE, are
	     undefined.

RETURN VALUES
     If successful, physio() returns 0.	 EFAULT is returned if the address
     range described by uio is not accessible by the requesting process.
     physio() will return any error resulting from calls to the device
     strategy routine, by examining the B_ERROR buffer flag and the `b_error'
     field.  Note that the actual transfer size may be less than requested by
     uio if the device signals an ``end of file'' condition.

SEE ALSO
     read(2), write(2)

OpenBSD 4.9		      September 22, 2010		   OpenBSD 4.9
[top]

List of man pages available for OpenBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net