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

Function sys___sysctl

freebsd/kern/kern_sysctl.c:2270–2294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2268};
2269#endif
2270int
2271sys___sysctl(struct thread *td, struct sysctl_args *uap)
2272{
2273 int error, i, name[CTL_MAXNAME];
2274 size_t j;
2275
2276 if (uap->namelen > CTL_MAXNAME || uap->namelen < 2)
2277 return (EINVAL);
2278
2279 error = copyin(uap->name, &name, uap->namelen * sizeof(int));
2280 if (error)
2281 return (error);
2282
2283 error = userland_sysctl(td, name, uap->namelen,
2284 uap->old, uap->oldlenp, 0,
2285 uap->new, uap->newlen, &j, 0);
2286 if (error && error != ENOMEM)
2287 return (error);
2288 if (uap->oldlenp) {
2289 i = copyout(&j, uap->oldlenp, sizeof(j));
2290 if (i)
2291 return (i);
2292 }
2293 return (error);
2294}
2295#endif
2296
2297int

Callers

nothing calls this directly

Calls 3

userland_sysctlFunction · 0.85
copyinFunction · 0.50
copyoutFunction · 0.50

Tested by

no test coverage detected