Jeff Mahoney | 12fa8ec | 2008-05-02 15:03:58 -0400 | [diff] [blame] | 1 | #ifndef _COMPAT_H_ |
| 2 | #define _COMPAT_H_ |
| 3 | |
David Woodhouse | 2db0496 | 2008-08-07 11:19:43 -0400 | [diff] [blame] | 4 | #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26) |
| 5 | #define trylock_page(page) (!TestSetPageLocked(page)) |
| 6 | #endif |
Jeff Mahoney | 12fa8ec | 2008-05-02 15:03:58 -0400 | [diff] [blame] | 7 | |
| 8 | /* |
| 9 | * Even if AppArmor isn't enabled, it still has different prototypes. |
| 10 | * Add more distro/version pairs here to declare which has AppArmor applied. |
| 11 | */ |
| 12 | #if defined(CONFIG_SUSE_KERNEL) |
| 13 | # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22) |
| 14 | # define REMOVE_SUID_PATH 1 |
| 15 | # endif |
| 16 | #endif |
| 17 | |
| 18 | /* |
| 19 | * catch any other distros that have patched in apparmor. This isn't |
| 20 | * 100% reliable because it won't catch people that hand compile their |
| 21 | * own distro kernels without apparmor compiled in. But, it is better |
| 22 | * than nothing. |
| 23 | */ |
| 24 | #ifdef CONFIG_SECURITY_APPARMOR |
| 25 | # define REMOVE_SUID_PATH 1 |
| 26 | #endif |
| 27 | |
| 28 | #endif /* _COMPAT_H_ */ |