Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Thursday, June 13, 2019
 
 

nvlist_count (3NVPAIR)

Name

nvlist_count - return number of nvpairs in the nvlist

Synopsis

cc [ flag... ] file... -lnvpair [ library... ]
#include <libnvpair.h>

int nvlist_count(nvlist_t *nvl, uint_t *npairs)

Description

The nvlist_count() function returns number of nvpairs in the given nvlist in *npairs. It is valid for all types of list. If one of the nvpairs is of type DATA_TYPE_NVLIST or DATA_TYPE_NVLIST_ARRAY, it is considered as one node.

Return Values

The nvlist_count() function returns 0 on success and an error value on failure.

Errors

The nvlist_count() function will fail with:

EINVAL

Invalid argument was provided.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe

See Also

libnvpair(3LIB), attributes(7)