data structures in snmp.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

i have couple of questions

1. i have just copied and pasted the below data structure from net/snmp.h

struct ip_mib
{
 	unsigned long	IpInReceives;
	.
	.
	.
	unsigned long   __pad[0];
} ____cacheline_aligned;

in the above structure what is ___cacheline_aligned
is it just a variable of type struct udp_mib
if so why doesnt the compiler throw an error saying declaration of 
___cacheline_aligned as it is seen in every structure defined in the file 
net/snmp.h
if i try to copy and paste the structures in a userland program it throws 
redeclaration of ___cacheline_aligned error.

2. if i use sizeof(struct ip_mib) from a kernel module it shows 96
but if i cut and paste the same data structure in a userland program the size 
is shown as 68.I dont understand why.

I dont understand where i m wrong.please clarify.

thanks and regards,
mohan.
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux