sysctl() system call
hi,
is anyone out there familiar with the system call 'sysctl'? i'm trying to figure out what some source code (zebra) is doing:
#define MIBSIZ 6
int mib[MIBSIZ] =
{
CTL_NET,
PF_ROUTE,
0,
0, /* AF_INET & AF_INET6 */
NET_RT_IFLIST,
0
};
/* Query buffer size. */
if (sysctl (mib, MIBSIZ, NULL, &bufsiz, NULL, 0) < 0)
...
/* Fetch interface informations into allocated buffer. */
if (sysctl (mib, MIBSIZ, buf, &bufsiz, NULL, 0) < 0)
...
the first argument is an array of ints, second one says how big the array is. the other args are buffers and sizes for the value read and the value to write.
i guess what i need to know is the format and content of the first argument. where is this defined?
cheers,
john c.
PS redhat 7.2, kernel 2.4.2-2
|