On 2005-05-21 18:49, shiner chen wrote:
In order to implement a dispacthing policy I want to get the status of cpu. I have read the code of top command and i find it get the status of cpu by the function :
   int sysctlbyname(const char *, void *, size_t *, void *, size_t);

I search the code of kernel ,then I consider that i can get the status of cpu through the funciton:
    int kernel_sysctlbyname(struct thread *td, char *name,  void *old, 
        size_t *oldlenp, void *new, size_t newlen,  size_t *retval);
I try to get the status of cpu by that function ,but it does not work!
You're looking at the wrong place.  There is a manpage for the 
sysctlbyname() function, which you obviously missed.
who can tell me the problem?
Nobody until you show us the source, I guess :-)

How do i get the status of cpu?
How do i use it if the funcion is right? what's the mean of the function's arguments ?
Start by reading the manpage of sysctlbyname().  Then, if you still have 
problems, you can post the source online somewhere and point us people 
at the URL.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to