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

Function db_sysctlbyname

freebsd/kern/kern_sysctl.c:2869–2888  ·  view source on GitHub ↗

* Show a sysctl by its user facing string */

Source from the content-addressed store, hash-verified

2867 * Show a sysctl by its user facing string
2868 */
2869static int
2870db_sysctlbyname(char *name, int flags)
2871{
2872 struct sysctl_oid *oidp;
2873 int oid[CTL_MAXNAME];
2874 int error, nlen;
2875
2876 error = name2oid(name, oid, &nlen, &oidp);
2877 if (error) {
2878 return (error);
2879 }
2880
2881 if ((oidp->oid_kind & CTLTYPE) == CTLTYPE_NODE) {
2882 db_show_sysctl_all(oid, nlen, flags);
2883 } else {
2884 error = db_show_oid(oidp, oid, nlen, flags);
2885 }
2886
2887 return (error);
2888}
2889
2890static void
2891db_sysctl_cmd_usage(void)

Callers 1

kern_sysctl.cFile · 0.85

Calls 3

db_show_sysctl_allFunction · 0.85
db_show_oidFunction · 0.85
name2oidFunction · 0.70

Tested by

no test coverage detected