MCPcopy Create free account
hub / github.com/F-Stack/f-stack / nvpair_move_binary

Function nvpair_move_binary

freebsd/contrib/libnv/bsd_nvpair.c:1609–1628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607#endif
1608
1609nvpair_t *
1610nvpair_move_binary(const char *name, void *value, size_t size)
1611{
1612 nvpair_t *nvp;
1613
1614 if (value == NULL || size == 0) {
1615 ERRNO_SET(EINVAL);
1616 return (NULL);
1617 }
1618
1619 nvp = nvpair_allocv(name, NV_TYPE_BINARY, (uint64_t)(uintptr_t)value,
1620 size, 0);
1621 if (nvp == NULL) {
1622 ERRNO_SAVE();
1623 nv_free(value);
1624 ERRNO_RESTORE();
1625 }
1626
1627 return (nvp);
1628}
1629
1630nvpair_t *
1631nvpair_move_bool_array(const char *name, bool *value, size_t nitems)

Callers 1

nvlist_move_binaryFunction · 0.85

Calls 1

nvpair_allocvFunction · 0.85

Tested by

no test coverage detected