blob: b3349a66999d20762b407d9dc853cdda908cac74 [file] [log] [blame]
Jeff Mahoney12fa8ec2008-05-02 15:03:58 -04001#ifndef _COMPAT_H_
2#define _COMPAT_H_
3
David Woodhouse2db04962008-08-07 11:19:43 -04004#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,26)
5#define trylock_page(page) (!TestSetPageLocked(page))
6#endif
Jeff Mahoney12fa8ec2008-05-02 15:03:58 -04007
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_ */