*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->OpenBSD man pages -> physio (9)              



NAME    [Toc]    [Back]

     physio - initiate I/O on raw devices

SYNOPSIS    [Toc]    [Back]

     physio(void (*strategy)(struct buf *), struct buf *bp, dev_t
             int flags, void (*minphys)(struct buf *), struct uio

DESCRIPTION    [Toc]    [Back]

     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, the buffer
     passed in bp is locked (marked as ``busy'') for the duration
of the entire

     A break-down of the arguments follows:

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

     bp      The buffer to use with the  strategy  routine.   The
buffer flags
             will  have B_BUSY, B_PHYS, and B_RAW set when passed
to the strategy
 routine.  If NULL, a buffer is allocated from  a
system pool.

     dev     The device number identifying the device to interact

     flags   Direction of transfer; the only valid  settings  are

             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

RETURN VALUES    [Toc]    [Back]

     If successful, physio() returns 0.  EFAULT  is  returned  if
the address
     range  described  by uio is not accessible by the requesting
     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    [Toc]    [Back]

     read(2), write(2)

OpenBSD      3.6                           June      15,     1996
[ Back ]
 Similar pages
Name OS Title
DtDndVaDragStart HP-UX initiate a drag
pam_start FreeBSD initiate a PAM transaction
DtDndDragStart HP-UX initiate a drag
connect NetBSD initiate a connection on a socket
t_sndrel HP-UX initiate an orderly release
SSL_connect Tru64 Initiate the TLS/SSL handshake with an TLS/SSL server
connect FreeBSD initiate a connection on a socket
SSL_connect NetBSD initiate the TLS/SSL handshake with an TLS/SSL server
SSL_connect OpenBSD initiate the TLS/SSL handshake with an TLS/SSL server
connect HP-UX initiate a connection on a socket
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service