Re: data structures in snmp.h

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

 



On Mon, Oct 22, 2001 at 03:50:29PM +0530, C. Mohanasundaram wrote:

> } ____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.

cacheline_aligned is a define expanding to a gcc __attribute__; the atrtibute
align is used to align the structure to a cache line (e.g. 32 bytes).

> 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 assume you removed the "__cacheline_aligned" bit in user space ?

john

-- 
"I'm frightened of figurines."
        - Pulp
-
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