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

Function nvpair_create_descriptor

freebsd/contrib/libnv/bsd_nvpair.c:1274–1292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1272
1273#ifndef _KERNEL
1274nvpair_t *
1275nvpair_create_descriptor(const char *name, int value)
1276{
1277 nvpair_t *nvp;
1278
1279 value = fcntl(value, F_DUPFD_CLOEXEC, 0);
1280 if (value < 0)
1281 return (NULL);
1282
1283 nvp = nvpair_allocv(name, NV_TYPE_DESCRIPTOR, (uint64_t)value,
1284 sizeof(int64_t), 0);
1285 if (nvp == NULL) {
1286 ERRNO_SAVE();
1287 close(value);
1288 ERRNO_RESTORE();
1289 }
1290
1291 return (nvp);
1292}
1293#endif
1294
1295nvpair_t *

Callers 1

nvpair_cloneFunction · 0.85

Calls 3

nvpair_allocvFunction · 0.85
fcntlFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected