blob: c1d0ae069b5343f9876b723743e695aea0c26bd8 [file] [log] [blame]
Jeff Dike1d3468a2006-07-10 04:45:13 -07001/*
Jeff Dikeba180fd2007-10-16 01:27:00 -07002 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Licensed under the GPL
4 */
5
Al Viro37185b32012-10-08 03:27:32 +01006#include <linux/file.h>
7#include <linux/fs.h>
8#include <linux/mm.h>
9#include <linux/sched.h>
10#include <linux/utsname.h>
11#include <linux/syscalls.h>
12#include <asm/current.h>
13#include <asm/mman.h>
14#include <asm/uaccess.h>
15#include <asm/unistd.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Linus Torvalds1da177e2005-04-16 15:20:36 -070017long old_mmap(unsigned long addr, unsigned long len,
18 unsigned long prot, unsigned long flags,
19 unsigned long fd, unsigned long offset)
20{
21 long err = -EINVAL;
22 if (offset & ~PAGE_MASK)
23 goto out;
24
Al Virof8b72562009-11-30 17:37:04 -050025 err = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 out:
27 return err;
28}