blob: eed54c53fbbb954456879d48b4f20b0afc33258d [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001// SPDX-License-Identifier: GPL-2.0
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00004 */
5
6#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 <linux/uaccess.h>
15#include <asm/unistd.h>
16
17long 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
25 err = ksys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
26 out:
27 return err;
28}