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

Function kenv_acquire

freebsd/kern/kern_environment.c:625–638  ·  view source on GitHub ↗

* Return the internal kenv buffer for the variable name, if it exists. * If the dynamic kenv is initialized and the name is present, return * with kenv_lock held. */

Source from the content-addressed store, hash-verified

623 * with kenv_lock held.
624 */
625static char *
626kenv_acquire(const char *name)
627{
628 char *value;
629
630 if (dynamic_kenv) {
631 mtx_lock(&kenv_lock);
632 value = _getenv_dynamic(name, NULL);
633 if (value == NULL)
634 mtx_unlock(&kenv_lock);
635 return (value);
636 } else
637 return (_getenv_static(name));
638}
639
640/*
641 * Undo a previous kenv_acquire() operation

Callers 4

testenvFunction · 0.70
getenv_stringFunction · 0.70
getenv_arrayFunction · 0.70
getenv_quadFunction · 0.70

Calls 4

mtx_lockFunction · 0.70
_getenv_dynamicFunction · 0.70
mtx_unlockFunction · 0.70
_getenv_staticFunction · 0.70

Tested by

no test coverage detected