* debug.ddb.scripting.unscript has somewhat unusual sysctl semantics -- set * the name of the script that you want to delete. */
| 544 | * the name of the script that you want to delete. |
| 545 | */ |
| 546 | static int |
| 547 | sysctl_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 | } |
| 565 | SYSCTL_PROC(_debug_ddb_scripting, OID_AUTO, unscript, |
| 566 | CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, |
| 567 | sysctl_debug_ddb_scripting_unscript, "A", |
nothing calls this directly
no test coverage detected