Distinguish between kernel and user space
Hi,
I have defined a header file for ioctls macros definitions. I am including it in both, my user space application as well as in my device driver. Now there are some macros that I want to be visible only in device drive and some only in user space application. Is there any set of macros defined in linux for such purpose? Thanks in advance Ravi Gupta |
Add this around your macros. __KERNEL__ is defined only in kernel space so this will isolate your kernel macros from being used in user space.
#if defined(__KERNEL__) #define YOUR_MACRO #endif |
@archieval ... thanks
|
All times are GMT -5. The time now is 12:04 PM. |