MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Driver Entry Points                                    awrite(9E)



NAME
     awrite - asynchronous write to a device

SYNOPSIS
     #include 
     #include 
     #include 
     #include 
     #include 

     intprefixawrite(devt dev, struct aioreq *aioreqp,
          credt *credp);


INTERFACE LEVEL
     Solaris DI specific (Solaris  DI).  This  entry  point  is
     optional.  Drivers  that  do  not support an  awrite() entry
     point should use  nodev(9F)

PARAMETERS
     dev         Device number.


     aioreqp    Pointer  to  the   aioreq(9S)  structure   that
                 describes where the data is stored.


     credp      Pointer to the  credential structure.


DESCRIPTION
     The driver's awrite() routine is called to perform an  asyn-
     chronous  write.  getminor(9F)  can  be  used to  access the
     minor number component of the dev argument. awrite() may use
     the  credential structure pointed to by  credp to check for
     superuser access by  calling   drvpriv(9F).  The   awrite()
     routine  may also examine the  uio(9S) structure through the
     aioreq structure pointer,   aioreqp.  awrite()  must  call
     aphysio(9F)  with  the  aioreq pointer and a pointer to the
     driver's strategy(9E) routine.


     No fields of the uio(9S) structure pointed  to  by  aioreq,
     other  than  uiooffset  or uioloffset, may be modified for
     non-seekable devices.

RETURN VALUES
     The  awrite() routine should return   0 for success, or  the
     appropriate error number.

CONTEXT




SunOS 5.11          Last change: 28 Mar 1997                    1






Driver Entry Points                                    awrite(9E)



     This function is called from user context only.

EXAMPLES
     Example 1 Using the awrite() routine:


     The following is an example of an  awrite() routine:


       static int
       xxawrite(devt dev, struct aioreq *aio, credt *credp)
       {
               int instance;
               struct xxstate *xsp;

               instance = getminor(dev);
               xsp = ddigetsoftstate(statep, instance);
               /*Verify soft state structure has been allocated */
               if (xsp == NUL)
                        return (ENXIO);
               return (aphysio(xxstrategy, anocancel, dev, BWRITE, \
               xxminphys, aio));
       }


SEE ALSO
     write(2), aiowrite(3C), aread(9E),  read(9E),  strategy(9E),
     write(9E),            anocancel(9F),            aphysio(9F),
     ddigetsoftstate(9F),     drvpriv(9F),      getminor(9F),
     minphys(9F), nodev(9F), aioreq(9S), cbops(9S), uio(9S)


     Writing Device Drivers

BUGS
     There is no way other than calling aphysio(9F) to accomplish
     an asynchronous write.


















SunOS 5.11          Last change: 28 Mar 1997                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™