Thomas Petazzoni wrote:
Hi,
canon wrote:
It's the first time I try to go use a kernel routine and I don't know
how to compile my application.
Actually, I want to realize a program which limit the cpu load of
another program. For this I need the user time of the application and
I find this in the /proc/<pid>/stat file. But, my program must be
accurate and need to read this file every ms (the operation cost
10ms). So, I tryed to get this information with the tast_struct
structure but I have a problem at compilation time.
When I include linux/sched.h, I have a lot of error message. I think
I should add some flag to my gcc command but I don't whose.
You can't use kernel functions in user-space applications. That's it.
Even if I am root, I cannot make my program entering the kernel space ?
I was thinking to write a special scheduler that can be configured to
reduce the load of the process, but I have neither the skills nor the
time. I suppose that I will keep the current solution if there is no
other way.
--
Canon
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/