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

Function resource_unset_value

freebsd/kern/subr_hints.c:496–517  ·  view source on GitHub ↗

* Clear a value associated with a device by removing it from * the kernel environment. This only removes a hint for an * exact unit. */

Source from the content-addressed store, hash-verified

494 * exact unit.
495 */
496int
497resource_unset_value(const char *name, int unit, const char *resname)
498{
499 char varname[128];
500 const char *retname, *retvalue;
501 int error, line;
502 size_t len;
503
504 line = 0;
505 error = resource_find(&line, NULL, name, &unit, resname, NULL,
506 &retname, NULL, NULL, NULL, NULL, &retvalue);
507 if (error)
508 return (error);
509
510 retname -= strlen("hint.");
511 len = retvalue - retname - 1;
512 if (len > sizeof(varname) - 1)
513 return (ENAMETOOLONG);
514 memcpy(varname, retname, len);
515 varname[len] = '\0';
516 return (kern_unsetenv(varname));
517}

Callers 1

devctl2_ioctlFunction · 0.85

Calls 3

kern_unsetenvFunction · 0.85
resource_findFunction · 0.70
memcpyFunction · 0.50

Tested by

no test coverage detected