blob: 3a875226c8efd4610f2a07b0d4dd801882255f8f [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 sys_fork(void)
18{
Al Viro8cddebd2012-10-17 02:26:48 -040019 return do_fork(SIGCHLD, 0,
Jeff Dikee0877f02005-06-25 14:55:21 -070020 &current->thread.regs, 0, NULL, NULL);
Linus Torvalds1da177e2005-04-16 15:20:36 -070021}
22
23long sys_vfork(void)
24{
Al Viro8cddebd2012-10-17 02:26:48 -040025 return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
Jeff Dikee0877f02005-06-25 14:55:21 -070026 &current->thread.regs, 0, NULL, NULL);
Al Virod2ce4e92012-09-20 09:28:25 -040027}
28
29long sys_clone(unsigned long clone_flags, unsigned long newsp,
30 void __user *parent_tid, void __user *child_tid)
31{
Al Virod2ce4e92012-09-20 09:28:25 -040032 return do_fork(clone_flags, newsp, &current->thread.regs, 0, parent_tid,
33 child_tid);
Linus Torvalds1da177e2005-04-16 15:20:36 -070034}
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036long old_mmap(unsigned long addr, unsigned long len,
37 unsigned long prot, unsigned long flags,
38 unsigned long fd, unsigned long offset)
39{
40 long err = -EINVAL;
41 if (offset & ~PAGE_MASK)
42 goto out;
43
Al Virof8b72562009-11-30 17:37:04 -050044 err = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT);
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 out:
46 return err;
47}