2 * Copyright (C) 2004-2006 Atmel Corporation
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 #include <linux/errno.h>
10 #include <linux/file.h>
12 #include <linux/unistd.h>
15 #include <asm/uaccess.h>
17 asmlinkage int sys_pipe(unsigned long __user *filedes)
24 if (copy_to_user(filedes, fd, sizeof(fd)))
30 asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
31 unsigned long prot, unsigned long flags,
32 unsigned long fd, off_t offset)
35 struct file *file = NULL;
37 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
38 if (!(flags & MAP_ANONYMOUS)) {
44 down_write(¤t->mm->mmap_sem);
45 error = do_mmap_pgoff(file, addr, len, prot, flags, offset);
46 up_write(¤t->mm->mmap_sem);