Use #if like <br><br><b><br></b>#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))<br><br>#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)<br> // New socket create function<br>#else<br>
// Old socket create function<br>#endif<br><br>LINUX_VERSION_CODE is defined somewhere in the kernel and you should get to use it easily.<br><br><br>HTH<br><br>Akash<br><br><br><div class="gmail_quote">On Fri, Aug 5, 2011 at 12:34 PM, Abu Rasheda <span dir="ltr"><<a href="mailto:rcpilot2010@gmail.com">rcpilot2010@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I am compiling my driver and have run into following scenario.<div><br></div><div>Socket create function got a new parameter in Vanila kenrel 2.6.33. while Scientific Linux has it back ported to 2.6.32. How do I handle this kind of situation ? so that my driver compiles for both kernel versions.</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>