<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 23, 2013 at 2:42 PM, Nuno Martins <span dir="ltr">&lt;<a href="mailto:nuno.m.g.martins@gmail.com" target="_blank">nuno.m.g.martins@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Saket,<div><br></div><div>At code level you can check the size of a long. If you are in 32 bit it will be 4 bytes, if you are in 64 bit it will be 8 bytes.</div>
<div><br></div><div>Probably there will be better ways and functions already with this test.</div>
<div><br></div><div>If you want to check it you just have to include the file that has those defines and put your code under a #if .</div><div><br></div><div>Best regards,</div><div>Nuno Martins</div><div><br></div></div>

<div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Oct 23, 2013 at 6:46 AM, Saket Sinha <span dir="ltr">&lt;<a href="mailto:saket.sinha89@gmail.com" target="_blank">saket.sinha89@gmail.com</a>&gt;</span> wrote:<br>

</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi,<br><div><br>I want to write a kernel module which depends on the kernel type (32 
or 64 bit).
There are some lines of code which I want to be included in the module 
if and only if the kernel is 32 bit and some lines of code which should 
be included if kernel is 64 bit.

<p>Is there anything like #if LINUX_VERSION_CODE &lt; KERNEL_VERSION(2,6,26) for this case ?</p><p>I know we have  CONFIG_X86_64 and CONFIG_X86_32 for  x86 architecture but how do I exactly check it in my module code?</p>


<p>Regards,</p><p>Saket Sinha<br></p><p><br></p><p><br></p></div></div>
<br></div></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">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>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Nuno Martins<br>
</font></span></div>
<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>
<br></blockquote></div><br></div><div class="gmail_extra">Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">You could see for proc fs or sys fs providing any facility that you can make use of. I am sure there has to be some.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">- Rohan</div></div>