nvlist_add_uint32(9F)
NAME
| SYNOPSIS
| INTERFACE LEVEL
| PARAMETERS
| DESCRIPTION
| RETURN VALUES
| CONTEXT
NAME
nvlist_add_boolean, nvlist_add_byte, nvlist_add_int16, nvlist_add_uint16, nvlist_add_int32, nvlist_add_uint32, nvlist_add_int64, nvlist_add_uint64, nvlist_add_string, nvlist_add_byte_array, nvlist_add_int16_array, nvlist_add_uint16_array, nvlist_add_int32_array, nvlist_add_uint32_array, nvlist_add_int64_array, nvlist_add_uint64_array, nvlist_add_string_array- add new name-value pair to nvlist_t
SYNOPSIS
#include <sys/nvpair.h>
int nvlist_add_boolean(nvlist_t *
nvl, char *
name);
int nvlist_add_byte(nvlist_t *
nvl, char *
name, uchar_t
val);
int nvlist_add_int16(nvlist_t *
nvl, char *
name, int16_t
val);
int nvlist_add_uint16(nvlist_t *
nvl, char *
name, uint16_t
val);
int nvlist_add_int32(nvlist_t *
nvl, char *
name, int32_t
val);
int nvlist_add_uint32(nvlist_t *
nvl, char *
name, uint32_t
val);
int nvlist_add_int64(nvlist_t *
nvl, char *
name, int64_t
val);
int nvlist_add_uint64(nvlist_t *
nvl, char *
name, uint64_t
val);
int nvlist_add_string(nvlist_t *
nvl, char *
name, char *
val);
int nvlist_add_byte_array(nvlist_t *
nvl, char *
name, uchar_t *
val, uint_t
nelem);
int nvlist_add_int16_array(nvlist_t *
nvl, char *
name, int16_t *
val, uint_t
nelem);
int nvlist_add_uint16_array(nvlist_t *
nvl, char *
name, uint16_t *
val, uint_t
nelem);
int nvlist_add_int32_array(nvlist_t *
nvl, char *
name, int32_t *
val, uint_t
nelem);
int nvlist_add_uint32_array(nvlist_t *
nvl, char *
name, uint32_t *
val, uint_t
nelem);
int nvlist_add_int64_array(nvlist_t *
nvl, char *
name, int64_t *
val, uint_t
nelem);
int nvlist_add_uint64_array(nvlist_t *
nvl, char *
name, uint64_t *
val, uint_t
nelem);
int nvlist_add_string_array(nvlist_t *
nvl, char *
name, char **
val, uint_t
nelem);
INTERFACE LEVEL
PARAMETERS
-
nvl
-
The nvlist_t to be processed.
-
name
-
Name of the name-value pair (nvpair).
-
nelem
-
Number of elements in value (that is, array size).
-
val
-
Value or starting address of the array value.
DESCRIPTION
These functions adds a new name-value pair to nvlist_t. The memory allocation policy follows that specified in nvlist_alloc(), nvlist_unpack(), or nvlist_dup(). See nvlist_alloc(9F). The uniqueness of nvpair name and data types follow the nvflag argument specified in nvlist_alloc().
If NV_UNIQUE_NAME was specified for nvflag, existing nvpairs with matching names are removed before the new nvpair is added.
If NV_UNIQUE_NAME_TYPE was specified for nvflag, existing nvpairs with matching names and data types are removed before the new nvpair is added.
If neither was specified for nvflag, the new nvpair is unconditionally added at the end of the list. The library preserves the order of the name-value pairs across packing, unpacking, and duplication.
RETURN VALUES
-
0
-
success
-
EINVAL
-
invalid argument
-
ENOMEM
-
insufficient memory
CONTEXT
These functions can be called from interrupt context only if the nvlist_t was allocated with the KM_NOSLEEP flag set. See nvlist_alloc(9F)
for a description of KM_NOSLEEP. These functions can be called from user context in all cases.
SunOS 5.9 Last Revised 27 September 2000
NAME
| SYNOPSIS
| INTERFACE LEVEL
| PARAMETERS
| DESCRIPTION
| RETURN VALUES
| CONTEXT