MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Contract Management Library Functions
                           ctdevstatusgetdevstate(3CONTRACT)



NAME
     ctdevstatusgetdevstate,         ctdevstatusgetaset,
     ctdevstatusgetminor, ctdevstatusgetnoneg - read con-
     tract status information from a status object

SYNOPSIS
     cc [ flag... ] file... -DLARGEFILE64SOURCE  -lcontract  [ library... ]
     #include 
     #include 

     int ctdevstatusgetdevstate(ctstathdlt stathdl,
          uintt *statep);


     int ctdevstatusgetaset(ctstathdlt stathdl,
          uintt *asetp);


     int ctdevstatusgetminor(ctstathdlt stathdl, char *buf,
          sizet *buflenp);


     int ctdevstatusgetnoneg(ctstathdlt stathdl,
          uintt *nonegp);


PARAMETERS
     asetp      a pointer to a uintt variable for receiving  the
                acceptable state set (such as A-set) for the con-
                tract


     buf        a buffer for receiving the devfs path of a  minor
                in a contract


     buflenp    a pointer to a variable of type sizet for  pass-
                ing  the size of the buffer buf. If the buffer is
                too small (< PATHMAX), the minimum size  of  the
                buffer  needed  (PATHMAX)  is passed back to the
                caller with this argument.


     nonegp     a pointer to a uintt variable for receiving  the
                setting of the "noneg" term


     stathdl    a      status      object       returned       by
                ctstatusread(3CONTRACT)





SunOS 5.11           Last change: 9 Aug 2007                    1






Contract Management Library Functions
                           ctdevstatusgetdevstate(3CONTRACT)



     statep     a pointer to a uintt variable for receiving  the
                current  state of the device which is the subject
                of the contract


DESCRIPTION
     These functions read  contract  status  information  from  a
     status  object  stathdl  returned  by  ctstatusread(). The
     detail level in the call to ctstatusread() needs to be  at
     least  CTDFIXED  for  the following calls to be successful.
     The  one  exception  is   ctdevstatusgetminor(),   which
     requires a detail level of CTDAL.


     The  ctdevstatusgetdevstate()  function   returns   the
     current state of the device which is the subject of the con-
     tract. This can be one of the following:

     CTDEVEVONLINE      The device is online  and  functioning
                           normally.


     CTDEVEVDEGRADED    The device is online but degraded.


     CTDEVEVOFLINE     The device is offline and not  config-
                           ured.



     The ctdevstatusgetaset() function returns the  A-set  of
     the  contract.  This can be the bitset of one or more of the
     following states: CTDEVEVONLINE,  CTDEVEVDEGRADED,  or
     CTDEVEVOFLINE.


     The ctdevstatusgetminor() function reads the devfs  path
     of  the  minor participating in the contract. The devfs path
     returned does not include the /devices prefix. If the buffer
     passed  in  by  the  caller  is  too small (< PATHMAX), the
     minimum size of the buffer required ( PATHMAX) is  returned
     to the caller via the buflenp argument.


     The ctdevstatusgetnoneg() function returns  the  "noneg"
     setting  for  the  contract. A value of 1 is returned in the
     nonegp argument if NONEG is set, else 0 is returned.

RETURN VALUES
     Upon successful completion, these functions return 0. Other-
     wise, they return a non-zero error value.



SunOS 5.11           Last change: 9 Aug 2007                    2






Contract Management Library Functions
                           ctdevstatusgetdevstate(3CONTRACT)



ERORS
     The ctdevstatusgetminor() function will fail if:

     EOVERFLOW    The buffer  size  is  too  small  to  hold  the
                  result.



     The ctdevstatusgetdevstate(), ctdevstatusgetaset(),
     ctdevstatusgetminor()    and   ctdevstatusgetnoneg()
     functions will fail if:

     EINVAL    An invalid argument was specified.


     ENOENT    The requested data is not present  in  the  status
               object.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    
     MT-Level                     Safe                        
    


SEE ALSO
     ctstatusfree(3CONTRACT),        ctstatusread(3CONTRACT),
     libcontract(3LIB),  contract(4),  devices(4), attributes(5),
     lfcompile(5)
















SunOS 5.11           Last change: 9 Aug 2007                    3






Contract Management Library Functions
                           ctdevstatusgetdevstate(3CONTRACT)






















































SunOS 5.11           Last change: 9 Aug 2007                    4






OpenSolaris man pages main menu

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