carta
dnvlist_take_descriptor(9freebsd)

dnvlist_take_descriptor9freebsd

Api for getting name/value pairs. nonexistent pairs do not raise an error.

Part of dnv(9freebsd).

Usage

bool

uint64_t

char *

nvlist_t *

int

void *

bool

uint64_t

char *

nvlist_t *

int

void *

Library

library “libnv”

Overview

The libnv library permits easy management of name/value pairs and can send and receive them over sockets. For more information, also see nv(9).

The dnvlist_get family of functions returns the value associated with the specified name. If an element of the specified name does not exist, the function returns the value provided in defval. Returned strings, nvlists, descriptors, binaries, or arrays must not be modified by the user. They still belong to the nvlist. If the nvlist is in an error state, attempts to use any of these functions will cause the program to abort.

The dnvlist_take family of functions returns the value associated with the specified name and removes the element from the nvlist. If an element of the supplied name does not exist, the value provided in defval is returned. When the value is a string, binary, or array value, the caller is responsible for freeing returned memory with free(3). When the value is an nvlist, the caller is responsible for destroying the returned nvlist with nvlist_destroy(). When the value is a descriptor, the caller is responsible for closing the returned descriptor with close(2).

History

  • Debian 13 (Trixie) to Debian 11 (Bullseye): the text shown here
  • Debian 10 (Buster)

History

The dnv API appeared in FreeBSD 11.0.

Authors

The dnv API was implemented by Pawel Jakub Dawidek ⟨[email protected]⟩ under sponsorship from the FreeBSD Foundation. This manual page was written by Adam Starak ⟨[email protected]⟩

From freebsd-manpages 12.2-2 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.