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

Function sysctl_debug_ddb_scripting_unscript

freebsd/ddb/db_script.c:546–564  ·  view source on GitHub ↗

* debug.ddb.scripting.unscript has somewhat unusual sysctl semantics -- set * the name of the script that you want to delete. */

Source from the content-addressed store, hash-verified

544 * the name of the script that you want to delete.
545 */
546static int
547sysctl_debug_ddb_scripting_unscript(SYSCTL_HANDLER_ARGS)
548{
549 char name[DB_MAXSCRIPTNAME];
550 int error;
551
552 bzero(name, sizeof(name));
553 error = sysctl_handle_string(oidp, name, sizeof(name), req);
554 if (error)
555 return (error);
556 if (req->newptr == NULL)
557 return (0);
558 mtx_lock(&db_script_mtx);
559 error = db_script_unset(name);
560 mtx_unlock(&db_script_mtx);
561 if (error == ENOENT)
562 return (EINVAL); /* Don't confuse sysctl consumers. */
563 return (0);
564}
565SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, unscript,
566 CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0,
567 sysctl_debug_ddb_scripting_unscript, "A",

Callers

nothing calls this directly

Calls 5

bzeroFunction · 0.85
sysctl_handle_stringFunction · 0.85
db_script_unsetFunction · 0.85
mtx_lockFunction · 0.50
mtx_unlockFunction · 0.50

Tested by

no test coverage detected