2 * Copyright (C) 2000 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL
6 #include "linux/sched.h"
8 #include "asm/uaccess.h"
9 #include "asm/unistd.h"
12 * Perform the select(nd, in, out, ex, tv) and mmap() system
13 * calls. Linux/i386 didn't use to be able to handle more than
14 * 4 system call parameters, so these system calls used a memory
15 * block for parameter passing..
18 struct mmap_arg_struct {
27 extern int old_mmap(unsigned long addr, unsigned long len,
28 unsigned long prot, unsigned long flags,
29 unsigned long fd, unsigned long offset);
31 int old_mmap_i386(struct mmap_arg_struct *arg)
33 struct mmap_arg_struct a;
36 if (copy_from_user(&a, arg, sizeof(a)))
39 err = old_mmap(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
44 struct sel_arg_struct {
46 fd_set *inp, *outp, *exp;
50 int old_select(struct sel_arg_struct *arg)
52 struct sel_arg_struct a;
54 if (copy_from_user(&a, arg, sizeof(a)))
56 /* sys_select() does the appropriate kernel locking */
57 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
60 /* The i386 version skips reading from %esi, the fourth argument. So we must do
63 int sys_clone(unsigned long clone_flags, unsigned long newsp, int *parent_tid,
64 int unused, int *child_tid)
68 /* XXX: normal arch do here this pass, and also pass the regs to
69 * do_fork, instead of NULL. Currently the arch-independent code
70 * ignores these values, while the UML code (actually it's
71 * copy_thread) does the right thing. But this should change,
74 newsp = UPT_SP(current->thread.regs);*/
75 current->thread.forking = 1;
76 ret = do_fork(clone_flags, newsp, NULL, 0, parent_tid, child_tid);
77 current->thread.forking = 0;
82 * Overrides for Emacs so that we follow Linus's tabbing style.
83 * Emacs will notice this stuff at the end of the file and automatically
84 * adjust the settings for this buffer only. This must remain at the end
86 * ---------------------------------------------------------------------------
88 * c-file-style: "linux"