On Sat, 13 Oct 2001, Paolo Pisati wrote:
>
> Someone can tell me why this piece of code doesn't work?
>
> #include
> #include
> #include
> #include
> #include
> #include
> #include
>
> int main(void) {
> int mib[5], *count;
Here you define 'count' as an uninitialised pointer to an inte
In the last episode (Oct 13), Paolo Pisati said:
> Someone can tell me why this piece of code doesn't work?
The sysctl(3) manpage says that arg 4 is a pointer to the length of the
storage area pointed to by arg 3. In fact, there's an example in the
manpage:
mib[0] = CTL_KERN;
Someone can tell me why this piece of code doesn't work?
#include
#include
#include
#include
#include
#include
#include
int main(void) {
int mib[5], *count;
mib[0]=CTL_NET;
mib[1]=PF_LINK;
mib[2]=NETLINK_GENERIC;
mib[3]=IFMIB_SYSTEM;
mib[4]=IFMIB_IFCOUNT;
sysctl(mib, 5, co
3 matches
Mail list logo