| 2268 | }; |
| 2269 | #endif |
| 2270 | int |
| 2271 | sys___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 | |
| 2297 | int |
nothing calls this directly
no test coverage detected