<br><br><div class="gmail_quote">On Tue, Jan 4, 2011 at 11:28 PM, Mulyadi Santosa <span dir="ltr"><<a href="mailto:mulyadi.santosa@gmail.com">mulyadi.santosa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jan 5, 2011 at 00:40, mohit verma <<a href="mailto:mohit89mlnc@gmail.com">mohit89mlnc@gmail.com</a>> wrote:<br>
><br>
> hi all,<br>
> i have seen many places in kernel where the variables specially the<br>
> structures should be of fixed size independent of the architecture. i went<br>
> through the definitions of them but dint get clearly (or frankly say<br>
> ...dint get them even a bit) .<br>
<br>
</div>Your question isn't specific enough, so I'll just guess. Let's say<br>
"int". In 32 bit, AFAIK it's 4 byte, but in 64 bit (like IA 64, not<br>
sure if it's x64) it's 8 byte. So, if you just say "int", you will<br>
likely getting screwed up.<br>
<br>
By using types like u_int or something like that, you pretty much say<br>
"I mean 4 byte kind of integer" etc<br></blockquote><div> </div><div>Still there can be padding issues due to byte alignment, which may vary across architecture. Am not sure if that is controllable (probably some pragma to gcc?). Probably, OP is asking about it?</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
--<br>
regards,<br>
<br>
Mulyadi Santosa<br>
Freelance Linux trainer and consultant<br>
<br>
blog: <a href="http://the-hydra.blogspot.com" target="_blank">the-hydra.blogspot.com</a><br>
training: <a href="http://mulyaditraining.blogspot.com" target="_blank">mulyaditraining.blogspot.com</a><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Rajesh S R<br><a href="http://rajeshsr.co.cc/blogs/">http://rajeshsr.co.cc/blogs/</a><br>