Skip to content

Commit

Permalink
[PATCH] NOMMU: supply get_unmapped_area() to fix NOMMU SYSV SHM
Browse files Browse the repository at this point in the history
Supply a get_unmapped_area() to fix NOMMU SYSV SHM support.

Signed-off-by: David Howells <[email protected]>
Acked-by: Adam Litke <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dhowells authored and Linus Torvalds committed Mar 23, 2007
1 parent 8da38d7 commit d56e03c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,28 @@ void unmap_mapping_range(struct address_space *mapping,
}
EXPORT_SYMBOL(unmap_mapping_range);

/*
* ask for an unmapped area at which to create a mapping on a file
*/
unsigned long get_unmapped_area(struct file *file, unsigned long addr,
unsigned long len, unsigned long pgoff,
unsigned long flags)
{
unsigned long (*get_area)(struct file *, unsigned long, unsigned long,
unsigned long, unsigned long);

get_area = current->mm->get_unmapped_area;
if (file && file->f_op && file->f_op->get_unmapped_area)
get_area = file->f_op->get_unmapped_area;

if (!get_area)
return -ENOSYS;

return get_area(file, addr, len, pgoff, flags);
}

EXPORT_SYMBOL(get_unmapped_area);

/*
* Check that a process has enough memory to allocate a new virtual
* mapping. 0 means there is enough memory for the allocation to
Expand Down

0 comments on commit d56e03c

Please sign in to comment.