DESCRIPTION

These functions add a new name-value pair to an 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 follows 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.