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

Function sysctl_rename_oid

freebsd/kern/kern_sysctl.c:879–891  ·  view source on GitHub ↗

* Rename an existing oid. */

Source from the content-addressed store, hash-verified

877 * Rename an existing oid.
878 */
879void
880sysctl_rename_oid(struct sysctl_oid *oidp, const char *name)
881{
882 char *newname;
883 char *oldname;
884
885 newname = strdup(name, M_SYSCTLOID);
886 SYSCTL_WLOCK();
887 oldname = __DECONST(char *, oidp->oid_name);
888 oidp->oid_name = newname;
889 SYSCTL_WUNLOCK();
890 free(oldname, M_SYSCTLOID);
891}
892
893/*
894 * Reparent an existing oid.

Callers 1

device_sysctl_updateFunction · 0.85

Calls 2

strdupFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected