MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Contract Management Library Functions    cteventread(3CONTRACT)



NAME
     cteventread,    cteventreadcritical,    cteventreset,
     cteventreliable,     cteventfree,    cteventgetflags,
     cteventgetctid,   cteventgetevid,   cteventgettype,
     cteventgetnevid,  cteventgetnewct  -  common  contract
     event functions

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

     int cteventread(int fd, ctevthdlt *evthndlp);


     int cteventreadcritical(int fd, ctevthdlt *evthndlp);


     int cteventreset(int fd);


     int cteventreliable(int fd);


     void cteventfree(ctevthdlt evthndl);


     ctidt cteventgetctid(ctevthdlt evthndl);


     ctevidt cteventgetevid(ctevthdlt evthndl);


     uintt cteventgetflags(ctevthdlt evthndl);


     uintt cteventgettype(ctevthdlt evthndl);


     int cteventgetnevid(ctevthdlt evthndl, ctevidt *evidp);


     int cteventgetnewct(ctevthdlt evthndl, ctidt *ctidp);


DESCRIPTION
     These functions operate  on  contract  event  endpoint  file
     descriptors  obtained  from  the contract(4) file system and
     event  object  handles  returned  by   cteventread()   and
     cteventreadcritical().






SunOS 5.11           Last change: 1 Apr 2004                    1






Contract Management Library Functions    cteventread(3CONTRACT)



     The cteventread() function reads the next event  from  the
     queue  referenced  by the file descriptor fd and initializes
     the event object handle pointed to by evthndlp. After a suc-
     cessful  call  to cteventread(), the caller is responsible
     for calling cteventfree() on this event object handle when
     it has finished using it.


     The   cteventreadcritical()   function    behaves    like
     cteventread() except that it reads the next critical event
     from the queue, skipping any intermediate events.


     The cteventreset() function resets  the  location  of  the
     listener to the beginning of the queue. This function can be
     used to re-read events, or read events that were sent before
     the  event endpoint was opened. Informative and acknowledged
     critical events, however, might have been removed  from  the
     queue.


     The cteventreliable() function  indicates  that  no  event
     published  to the specified event queue should be dropped by
     the system until the specified listener has read the  event.
     This   function   requires   that   the   caller   have  the
     {PRIVCONTRACTEVENT} privilege in its effective set.


     The cteventfree() function frees  any  storage  associated
     with the event object handle specified by evthndl.


     The cteventgetctid() function returns the ID of the  con-
     tract that sent the specified event.


     The cteventgetevid()  function  returns  the  ID  of  the
     specified event.


     The cteventgetflags() function returns  the  event  flags
     for the specified event. Valid event flags are:

     CTEINFO    The event is an informative event.


     CTEACK     The event has been  acknowledged  (for  critical
                 and negotiation messages).


     CTENEG     The message represents an exit negotiation.




SunOS 5.11           Last change: 1 Apr 2004                    2






Contract Management Library Functions    cteventread(3CONTRACT)



     The cteventgettype() function reads the event  type.  The
     value  is one of the event types described in contract(4) or
     the contract type's manual page.


      The cteventgetnevid() function reads the negotiation  ID
     from an CTEVNEGEND event.


     The cteventgetnewct() function obtains the ID of the con-
     tract   created  when  the  negotiation  referenced  by  the
     CTEVNEGEND event succeeded. If no  contract  was  created,
     ctidp  will  be  0.   If the operation was cancelled, *ctidp
     will equal the ID of the existing contract.

RETURN VALUES
     Upon      successful      completion,       cteventread(),
     cteventreadcritical(),                  cteventreset(),
     cteventreliable(),        cteventgetnevid(),        and
     cteventgetnewct()  return  0.  Otherwise,  they  return a
     non-zero error value.


     The        cteventgetflags(),        cteventgetctid(),
     cteventgetevid(),   and   cteventgettype()   functions
     return data as described in the DESCRIPTION.

ERORS
     The cteventreliable() function will fail if:

     EPERM    The caller does not have  {PRIVCONTRACTEVENT}  in
              its effective set.



     The cteventread() and  cteventreadcritical()  functions
     will fail if:

     EAGAIN    The event endpoint was opened  ONONBLOCK  and  no
               applicable events were available to be read.



     The The cteventgetnevid() and cteventgetnewct()  func-
     tions will fail if:

     EINVAL    The evthndl argument is not a  CTEVNEGEND  event
               object.


ATRIBUTES




SunOS 5.11           Last change: 1 Apr 2004                    3






Contract Management Library Functions    cteventread(3CONTRACT)



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



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Evolving                    
    
     MT-Level                     Safe                        
    


SEE ALSO
     libcontract(3LIB), contract(4), attributes(5), lfcompile(5)







































SunOS 5.11           Last change: 1 Apr 2004                    4



OpenSolaris man pages main menu

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