FreeBSD 4.11 manual page repository

FreeBSD is a free computer operating system based on BSD UNIX originally. Many IT companies, like DeployIS is using it to provide an up-to-date, stable operating system.

physio - initiate I/O on raw devices



      physio - initiate I/O on raw devices


      #include <sys/param.h>
      #include <sys/systm.h>
      #include <sys/buf.h>
      physio(dev_t dev, struct uio *uio, int ioflag);


      The 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 pro‐
      cess into memory.  This is done by setting the P_PHYSIO flag on the pro‐
      cess.  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 transfer.
      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, and B_PHYS set when passed to the strategy rou‐
              tine.  If NULL, a buffer is allocated from a system pool.
      dev     The device number identifying the device to interact with.
      flags   Direction of transfer; the only valid settings are B_READ or
              A device specific routine called to determine the maximum trans‐
              fer 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
      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 strat‐
      egy 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.
      read(2), write(2)


Based on BSD UNIX
FreeBSD is an advanced operating system for x86 compatible (including Pentium and Athlon), amd64 compatible (including Opteron, Athlon64, and EM64T), UltraSPARC, IA-64, PC-98 and ARM architectures. It is derived from BSD, the version of UNIX developed at the University of California, Berkeley. It is developed and maintained by a large team of individuals. Additional platforms are in various stages of development.