Re: Compiling kernel module ...

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

 



Use #if like


#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33)
           // New socket create function
#else
           // Old socket create function
#endif

LINUX_VERSION_CODE is defined somewhere in the kernel and you should get to use it easily.


HTH

Akash


On Fri, Aug 5, 2011 at 12:34 PM, Abu Rasheda <rcpilot2010@xxxxxxxxx> wrote:
I am compiling my driver and have run into following scenario.

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.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[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