linux kernel head file -


i trying know size of task_struct. have downloaded linux source code website , have generated head files via typing command make headers_install terminal in source code file root directory.

#include<stdio.h> #include<linux/sched.h> int main() {     printf("%d\n",sizeof(struct task_struct)).     return 0; } 

typing command termial compile , source code gcc -g -i *path/to/linux*-source/usr/include test.c -o test. terminal shows struct task_struct not define stuff. guys me figure out? appreciated.

this struct kernel internal use only. it's definition pretty long , largely varies depending on kernel configuration. so, struct size varies depending on kernel configuration, , can't user-space.

unless, extract kernel config, bad idea, me. better 1 write kernel module.


Comments