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. Sincerly, Thomas -- Thomas Petazzoni thomas.petazzoni@xxxxxxxx -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/