]>
Commit | Line | Data |
---|---|---|
e9ce8d39 A |
1 | /* |
2 | * ---------------------------------------------------------------------------- | |
3 | * "THE BEER-WARE LICENSE" (Revision 42): | |
4 | * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you | |
5 | * can do whatever you want with this stuff. If we meet some day, and you think | |
6 | * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp | |
7 | * ---------------------------------------------------------------------------- | |
8 | * | |
e9ce8d39 | 9 | */ |
9385eb3d A |
10 | |
11 | #include <sys/cdefs.h> | |
12 | __FBSDID("$FreeBSD: src/lib/libc/gen/sysctlbyname.c,v 1.5 2002/02/01 00:57:29 obrien Exp $"); | |
13 | ||
e9ce8d39 A |
14 | #include <sys/types.h> |
15 | #include <sys/sysctl.h> | |
16 | #include <string.h> | |
23e20b00 A |
17 | #include <sys/errno.h> |
18 | #include <TargetConditionals.h> | |
19 | ||
a9aaacca A |
20 | #include "sysctl_internal.h" |
21 | ||
e9ce8d39 A |
22 | |
23 | int | |
24 | sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *newp, | |
25 | size_t newlen) | |
26 | { | |
e9ce8d39 | 27 | int error; |
e9ce8d39 | 28 | |
a9aaacca | 29 | |
23e20b00 | 30 | error = __sysctlbyname(name, strlen(name), oldp, oldlenp, newp, newlen); |
a9aaacca | 31 | if (error < 0) { |
e9ce8d39 | 32 | return error; |
a9aaacca A |
33 | } |
34 | ||
35 | ||
36 | return error; | |
e9ce8d39 A |
37 | } |
38 |