MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Pool Configuration Manipulation Library Functions
                                          poolvaluealloc(3POL)



NAME
     poolvaluealloc,   poolvaluefree,    poolvaluegetbool,
     poolvaluegetdouble,                 poolvaluegetint64,
     poolvaluegetname,                  poolvaluegetstring,
     poolvaluegettype,                  poolvaluegetuint64,
     poolvaluesetbool,                  poolvaluesetdouble,
     poolvaluesetint64,                   poolvaluesetname,
     poolvaluesetstring, poolvaluesetuint64 - resource pool
     property value manipulation functions

SYNOPSIS
     cc [ flag... ] file... -lpool [ library... ]
     #include 

     poolvaluet *poolvaluealloc(void);


     void poolvaluefree(poolvaluet *value);


     poolvalueclasst poolvaluegettype(
          const poolvaluet *value);


     int poolvaluegetbool(const poolvaluet *value,
          uchart *bool);


     int poolvaluegetdouble(const poolvaluet *value,
          double *d);


     int poolvaluegetint64(const poolvaluet *value,
          int64t *i64);


     int poolvaluegetstring(const poolvaluet *value,
          const char **strp);


     int poolvaluegetuint64(const poolvaluet *value,
          uint64t *ui64);


     void poolvaluesetbool(const poolvaluet *value,
          uchart bool);


     void poolvaluesetdouble(const poolvaluet *value,
          double d);




SunOS 5.11          Last change: 23 Sep 2003                    1






Pool Configuration Manipulation Library Functions
                                          poolvaluealloc(3POL)



     void poolvaluesetint64(const poolvaluet *value,
          int64t i64);


     int poolvaluesetstring(const poolvaluet *value,
          const char *strp);


     void poolvaluesetuint64(const poolvaluet *value,
          uint64t ui64);


     const char *poolvaluegetname(const poolvaluet *value);


     int poolvaluesetname(const poolvaluet *value,
          const char *name);


DESCRIPTION
     A poolvaluet is an  opaque  type  representing  the  typed
     value  portion  of  a pool property. For a list of the types
     supported by a poolvaluet, see poolgetproperty(3POL).


     The poolvaluealloc() function  allocates  and  returns  an
     opaque   container   for   a   pool   property   value.  The
     poolvaluefree() function must  be  called  explicitly  for
     allocated property values.


     The     poolvaluegetbool(),      poolvaluegetdouble(),
     poolvaluegetint64(),     poolvaluegetstring(),     and
     poolvaluegetuint64() functions retrieve  the  value  con-
     tained  in the poolvaluet pointed to by value to the loca-
     tion pointed to by the second argument. If the type  of  the
     value does not match that expected by the function, an error
     value   is    returned.     The    string    retrieved    by
     poolvaluegetstring()  is  freed  by  the library when the
     value is overwritten or poolvaluefree() is called  on  the
     pool property value.


     The poolvaluegettype() function returns the type  of  the
     data  contained  by  a  poolvaluet. If the value is unused
     then a type of POCINVAL is returned.


     The     poolvaluesetbool(),      poolvaluesetdouble(),
     poolvaluesetint64(),     poolvaluesetstring(),     and
     poolvaluesetuint64() functions set the value and type  of



SunOS 5.11          Last change: 23 Sep 2003                    2






Pool Configuration Manipulation Library Functions
                                          poolvaluealloc(3POL)



     the   property   value   to   the   provided   values.   The
     poolvaluesetstring() function copies the string passed in
     and returns -1 if the memory allocation fails.


     Property values can optionally have names. These  names  are
     used to describe properties as name=value pairs in the vari-
     ous query functions  (see  poolqueryresources(3POL)).   A
     copy  of  the string passed to poolvaluesetname() is made
     by   the   library,    and    the    value    returned    by
     poolvaluegetname()  is  freed  when  the  poolvaluet is
     deallocated or overwritten.

RETURN VALUES
     Upon successful  completion,  poolvaluealloc()  returns  a
     pool property value with type initialized to PVCINVAL. Oth-
     erwise, NUL is returned and poolerror() returns the  pool-
     specific error value.


     Upon successful  completion,  poolvaluegettype()  returns
     the  type  contained  in  the property value passed in as an
     argument. Otherwise, POCINVAL is returned and  poolerror()
     returns the pool-specific error value.


     Upon    successful    completion,     poolvaluegetbool(),
     poolvaluegetdouble(),             poolvaluegetint64(),
     poolvaluegetstring(), and poolvaluegetuint64()  return
     0.  Otherwise  -1  is returned and poolerror(3POL) returns
     the pool-specific error value.


     Upon  successful  completion,  poolvaluesetstring()   and
     poolvaluesetname()  return  0.  If  the memory allocation
     failed, -1 is returned and poolerror()  returns  the  pool-
     specific error value.

ERORS
     The poolvaluealloc() function will fail if:

     POESYSTEM    A system error has occurred. Check the  system
                   error code for more details.



     The     poolvaluegetbool(),      poolvaluegetdouble(),
     poolvaluegetint64(),     poolvaluegetstring(),     and
     poolvaluegetuint64() functions will fail if:





SunOS 5.11          Last change: 23 Sep 2003                    3






Pool Configuration Manipulation Library Functions
                                          poolvaluealloc(3POL)



     POEBADPARAM    The supplied value does not match  the  type
                     of the requested operation.



     The poolvaluesetstring() function will fail if:

     POESYSTEM    A system error has occurred. Check the  system
                   error code for more details.



     The poolvaluesetname() function will fail if:

     POESYSTEM    A system error has occurred. Check the  system
                   error code for more details.


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



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     CSI                          Enabled                     
    
     Interface Stability          Unstable                    
    
     MT-Level                     Safe                        
    


SEE ALSO
     libpool(3LIB), poolerror(3POL), attributes(5)

















SunOS 5.11          Last change: 23 Sep 2003                    4






Pool Configuration Manipulation Library Functions
                                          poolvaluealloc(3POL)






















































SunOS 5.11          Last change: 23 Sep 2003                    5






OpenSolaris man pages main menu

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