MCPcopy Index your code
hub / github.com/F-Stack/f-stack / name2oid

Function name2oid

tools/sysctl/sysctl.c:1080–1096  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078 */
1079
1080static int
1081name2oid(const char *name, int *oidp)
1082{
1083 int oid[2];
1084 int i;
1085 size_t j;
1086
1087 oid[0] = CTL_SYSCTL;
1088 oid[1] = CTL_SYSCTL_NAME2OID;
1089
1090 j = CTL_MAXNAME * sizeof(int);
1091 i = sysctl(oid, 2, oidp, &j, name, strlen(name));
1092 if (i < 0)
1093 return (i);
1094 j /= sizeof(int);
1095 return (j);
1096}
1097
1098static int
1099oidfmt(int *oid, int len, char *fmt, u_int *kind)

Callers 1

parseFunction · 0.70

Calls 1

sysctlFunction · 0.85

Tested by

no test coverage detected