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;
           mib[1] = KERN_MAXPROC;
           len = sizeof(maxproc);
           sysctl(mib, 2, &maxproc, &len, NULL, 0);

Note: always compile your programs with -Wall.  gcc would have flagged
this as:

test.c:18: warning: passing arg 4 of `sysctl' makes pointer from integer without a cast


-- 
        Dan Nelson
        [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to