* This function uses a presently undocumented interface to the kernel * to walk the tree and get the type so it can print the value. * This interface is under work and consideration, and should probably * be killed with a big axe by the first person who can find the time. * (be aware though, that the proper interface isn't as obvious as it * may seem, there are various conflicting requirement
| 43 | * may seem, there are various conflicting requirements. |
| 44 | */ |
| 45 | int |
| 46 | sysctlnametomib(const char *name, int *mibp, size_t *sizep) |
| 47 | { |
| 48 | int oid[2]; |
| 49 | int error; |
| 50 | |
| 51 | oid[0] = 0; |
| 52 | oid[1] = 3; |
| 53 | |
| 54 | *sizep *= sizeof(int); |
| 55 | error = sysctl(oid, 2, mibp, sizep, name, strlen(name)); |
| 56 | *sizep /= sizeof(int); |
| 57 | return (error); |
| 58 | } |
no test coverage detected