Results 1 to 2 of 2
Hello everyone,
I needed to access a process information through a program. I know I can use the information give in /proc/[pid]/ but I was trying to go for the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 08-19-2010 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 27
Unable to find task_struct{} structure in /usr/include/linux/sched.h
Hello everyone,
I needed to access a process information through a program. I know I can use the information give in /proc/[pid]/ but I was trying to go for the other option, by using task_struct structure. All the programs or examples that I have found by searching just include the file <linux/sched.h> but that file doesn't seem to contain any such declaration.
Apparently, the same header file contains the structure (and is a lot bigger too) in the src code /usr/src/linux-<kernel version>/include/linux/sched.h
Could anyone tell me why this difference? And how should I use it? Compiling the code after including it throws tremendous amount of errors, because of the included <linux/*> header files in it.
- 08-21-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,160
The stuff in /usr/include/linux will be for user-space programs only, so you won't find stuff like the task_struct structure, etc. there. These constructs are only in the kernel headers which is why you find them in /usr/src/linux..../include/linux, which is where the kernel headers will be found that are necessary for writing kernel modules, drivers, etc.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
