Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Sanitise linux/mman.h for userspace consumption

It only really needs to define a few constants and include <asm/mman.h>
when it's used by userspace. Move the rest within #ifdef __KERNEL__

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

+8 -5
+8 -5
include/linux/mman.h
··· 1 1 #ifndef _LINUX_MMAN_H 2 2 #define _LINUX_MMAN_H 3 3 4 - #include <linux/config.h> 5 - #include <linux/mm.h> 6 - 7 - #include <asm/atomic.h> 8 4 #include <asm/mman.h> 9 5 10 6 #define MREMAP_MAYMOVE 1 ··· 9 13 #define OVERCOMMIT_GUESS 0 10 14 #define OVERCOMMIT_ALWAYS 1 11 15 #define OVERCOMMIT_NEVER 2 16 + 17 + #ifdef __KERNEL__ 18 + #include <linux/config.h> 19 + #include <linux/mm.h> 20 + 21 + #include <asm/atomic.h> 22 + 12 23 extern int sysctl_overcommit_memory; 13 24 extern int sysctl_overcommit_ratio; 14 25 extern atomic_t vm_committed_space; ··· 66 63 _calc_vm_trans(flags, MAP_EXECUTABLE, VM_EXECUTABLE) | 67 64 _calc_vm_trans(flags, MAP_LOCKED, VM_LOCKED ); 68 65 } 69 - 66 + #endif /* __KERNEL__ */ 70 67 #endif /* _LINUX_MMAN_H */