Print this page
patch more-manpage
patch cleanup


 140 
 141 
 142        The nvlist_alloc() function allocates a new name-value pair list and
 143        updates nvlp to point to the handle. The argument nvflag specifies
 144        nvlist_t properties to remain persistent across packing, unpacking, and
 145        duplication.
 146 
 147 
 148        If NV_UNIQUE_NAME is specified for nvflag, existing nvpairs with
 149        matching names are removed before the new nvpair is added. If
 150        NV_UNIQUE_NAME_TYPE is specified for nvflag, existing nvpairs with
 151        matching names and data types are removed before the new nvpair is
 152        added. See nvlist_add_byte(9F) for more details.
 153 
 154 
 155        The nvlist_xalloc() function differs from nvlist_alloc() in that
 156        nvlist_xalloc() can use a different allocator, as described in the
 157        Pluggable Allocators section.
 158 
 159 
 160        The nvlist_free() function frees a name-value pair list.

 161 
 162 
 163        The nvlist_size() function returns the minimum size of a contiguous
 164        buffer large enough to pack nvl. The encoding parameter specifies the
 165        method of encoding when packing nvl. Supported encoding methods are:
 166 
 167        NV_ENCODE_NATIVE
 168                            Straight bcopy() as described in bcopy(9F).
 169 
 170 
 171        NV_ENCODE_XDR
 172                            Use XDR encoding, suitable for sending to another
 173                            host.
 174 
 175 
 176 
 177        The nvlist_pack() function packs nvl into contiguous memory starting at
 178        *bufp. The encoding parameter specifies the method of encoding (see
 179        above).
 180 


 443 
 444 
 445 CONTEXT
 446        The nvlist_alloc(), nvlist_pack(), nvlist_unpack(), and nvlist_dup()
 447        functions can be called from interrupt context only if the KM_NOSLEEP
 448        flag is set. They can be called from user context with any valid flag.
 449 
 450 
 451        The nvlist_xalloc(), nvlist_xpack(), nvlist_xunpack(), and
 452        nvlist_xdup() functions can be called from interrupt context only if
 453        (1) the default allocator is used and the KM_NOSLEEP flag is set or (2)
 454        the specified allocator did not sleep for free memory (for example, it
 455        uses a pre-allocated buffer for memory allocations).
 456 
 457 
 458        These functions can be called from user or kernel context with any
 459        valid flag.
 460 
 461 
 462 
 463                                January 16, 2006               NVLIST_ALLOC(9F)


 140 
 141 
 142        The nvlist_alloc() function allocates a new name-value pair list and
 143        updates nvlp to point to the handle. The argument nvflag specifies
 144        nvlist_t properties to remain persistent across packing, unpacking, and
 145        duplication.
 146 
 147 
 148        If NV_UNIQUE_NAME is specified for nvflag, existing nvpairs with
 149        matching names are removed before the new nvpair is added. If
 150        NV_UNIQUE_NAME_TYPE is specified for nvflag, existing nvpairs with
 151        matching names and data types are removed before the new nvpair is
 152        added. See nvlist_add_byte(9F) for more details.
 153 
 154 
 155        The nvlist_xalloc() function differs from nvlist_alloc() in that
 156        nvlist_xalloc() can use a different allocator, as described in the
 157        Pluggable Allocators section.
 158 
 159 
 160        The nvlist_free() function frees a name-value pair list. If nvl is a
 161        null pointer, no action occurs.
 162 
 163 
 164        The nvlist_size() function returns the minimum size of a contiguous
 165        buffer large enough to pack nvl. The encoding parameter specifies the
 166        method of encoding when packing nvl. Supported encoding methods are:
 167 
 168        NV_ENCODE_NATIVE
 169                            Straight bcopy() as described in bcopy(9F).
 170 
 171 
 172        NV_ENCODE_XDR
 173                            Use XDR encoding, suitable for sending to another
 174                            host.
 175 
 176 
 177 
 178        The nvlist_pack() function packs nvl into contiguous memory starting at
 179        *bufp. The encoding parameter specifies the method of encoding (see
 180        above).
 181 


 444 
 445 
 446 CONTEXT
 447        The nvlist_alloc(), nvlist_pack(), nvlist_unpack(), and nvlist_dup()
 448        functions can be called from interrupt context only if the KM_NOSLEEP
 449        flag is set. They can be called from user context with any valid flag.
 450 
 451 
 452        The nvlist_xalloc(), nvlist_xpack(), nvlist_xunpack(), and
 453        nvlist_xdup() functions can be called from interrupt context only if
 454        (1) the default allocator is used and the KM_NOSLEEP flag is set or (2)
 455        the specified allocator did not sleep for free memory (for example, it
 456        uses a pre-allocated buffer for memory allocations).
 457 
 458 
 459        These functions can be called from user or kernel context with any
 460        valid flag.
 461 
 462 
 463 
 464                                February 15, 2016              NVLIST_ALLOC(9F)