Results 1 to 2 of 2
Hi,
I have a question about Linux kernel programming and I hope you will answer it:
structure "slab" is defined in kernel code named "slab.c" (it is not defined in ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-12-2009 #1Just Joined!
- Join Date
- Sep 2009
- Posts
- 2
kernel programming
Hi,
I have a question about Linux kernel programming and I hope you will answer it:
structure "slab" is defined in kernel code named "slab.c" (it is not defined in any kernel header).
I want to use it in my code. how can I typedef it ?Code:struct slab { struct list_head list; unsigned long colouroff; void *s_mem; /* including colour offset */ unsigned int inuse; /* num of objs active in slab */ unsigned short nodeid; };
- 10-12-2009 #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 fact that it is not declared in a header means that it is for the private use of the kernel. You can simply cut/paste the definition to your own code and typedef it as you desire, bearing in mind that if the kernel changes this structure your code will no longer be in sync with the kernel if that is important to you.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
