1
2
3
4
5
6
7
8
9
10
11
12
13#include <linux/errno.h>
14#include <linux/sched.h>
15#include <linux/mm.h>
16#include <linux/fs.h>
17#include <linux/smp.h>
18#include <linux/sem.h>
19#include <linux/msg.h>
20#include <linux/shm.h>
21#include <linux/stat.h>
22#include <linux/mman.h>
23#include <linux/file.h>
24#include <linux/syscalls.h>
25#include <linux/ipc.h>
26
27#include <asm/setup.h>
28#include <linux/uaccess.h>
29
30asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
31 unsigned long prot, unsigned long flags,
32 unsigned long fd, unsigned long pgoff)
33{
34
35
36
37
38
39 if (pgoff & ((1 << (PAGE_SHIFT - 12)) - 1))
40 return -EINVAL;
41
42 return sys_mmap_pgoff(addr, len, prot, flags, fd,
43 pgoff >> (PAGE_SHIFT - 12));
44}
45