On Fri, Aug 5, 2011 at 5:10 PM, Akash <span dir="ltr"><<a href="mailto:email2akashjain@gmail.com">email2akashjain@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Use #if like <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></blockquote><div><br>I do this in many parts of my code. Issue in this particular case is different. In Vanila kernel this change appears in 2.6.33 and in Scientific Linux this change appears in 2.6.32. So in addition to LINUX_KERNEL_VERSION, I have to use some distribution specific #if. <br>
<br>I was wondwring what is general practice in this regard.<br></div></div>