8 #include <linux/errno.h>
11 #include <linux/mman.h>
12 #include <linux/sched.h>
13 #include <linux/shm.h>
20 #include <asm/shmparam.h>
21 #include <asm/uaccess.h>
25 unsigned long pgoff,
unsigned long flags)
42 #ifdef CONFIG_HUGETLB_PAGE
49 if (map_shared && (
TASK_SIZE > 0xfffffffful))
59 start_addr = addr = (addr + align_mask) & ~align_mask;
71 if (!vma || addr + len <= vma->
vm_start) {
76 addr = (vma->
vm_end + align_mask) & ~align_mask;
153 if (!IS_ERR((
void *) addr))
165 if (!IS_ERR((
void *) addr))
172 unsigned long new_addr)
174 addr =
sys_mremap(addr, old_len, new_len, flags, new_addr);
175 if (!IS_ERR((
void *) addr))