LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-14-2005, 01:39 AM   #1
cranium2004
Member
 
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223

Rep: Reputation: 30
how to calculate kernel structure size?


hello,
I want to know how can i calculate sizeof(struct skb_shared_info)). |The structure is written in skbuff.h file. Is there any way to do it in user C program?
regards,
cranium

Last edited by cranium2004; 04-14-2005 at 01:41 AM.
 
Old 04-15-2005, 04:09 AM   #2
zeropash
Member
 
Registered: Apr 2003
Location: Bangalore,India
Distribution: FC2, RHES, RH9, FC3, FC1, Slackware 3.0
Posts: 208

Rep: Reputation: 30
cat > sk.c
#include <linux/skbuff.h>

int main() {
printf("size = %d\n", sizeof(struct skb_shared_info));
}
^D
cc -D__KERNEL__ -I/usr/src/linux-2.6.11.2/include/ sk.c
I dont know how much you can rely on the size of this (because I dont know what other macros may be defined. at the time of kernel compilation.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What way is best for understand OS (linux or unix) kernel structure Nad0xFF Programming 11 04-06-2005 01:19 PM
error in accessing structure variable in kernel modules dypgrp Programming 3 01-17-2005 07:42 AM
how can i calculate an image size w/o creating one? rhxk Linux - Software 2 11-10-2004 04:52 PM
sizeof() return wrong size of structure?? Hammo Programming 7 02-21-2004 04:08 PM
kernel size Nerun Linux - General 4 02-20-2002 11:09 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration