Go to main content

man pages section 3: Extended Library Functions, Volume 3

Exit Print View

Updated: Thursday, June 13, 2019
 
 

nvlist_remove_all(3NVPAIR)

Name

nvlist_remove, nvlist_remove_all - remove name-value pairs

Synopsis

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

int nvlist_remove(nvlist_t *nvl, const char *name,
     data_type_t type);
int nvlist_remove_all(nvlist_t *nvl, const char *name);

Parameters

nvl

The nvlist_t to be processed.

name

Name of the name-value pair to be removed.

type

Data type of the nvpair to be removed.

Description

The nvlist_remove() function removes the first occurrence of nvpair that matches the name and the type.

The nvlist_remove_all() function removes all occurrences of nvpair that match the name, regardless of type.

Multiple threads can simultaneously read the same nvlist_t but only one thread can actively change a given nvlist_t at a time. The caller is responsible for the synchronization.

Return Values

These functions return 0 on success and an error value on failure.

Errors

These functions will fail if:

EINVAL

There is an invalid argument.

ENOENT

No name-value pairs were found to match the criteria specified by name and type.

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)