linux-arch-owner@xxxxxxxxxxxxxxx 写于 2009-06-10 01:52:47: > On Tuesday 09 June 2009, liqin.chen@xxxxxxxxxxxxx wrote: > > +asmlinkage long sys_mmap(unsigned long addr, size_t len, > > + unsigned long prot, unsigned long flags, > > + unsigned long fd, off_t offset) > > +{ > > + int err = -EINVAL; > > + > > + if (offset & ~PAGE_MASK) { > > + printk(KERN_INFO "no pagemask in mmap\r\n"); > > + goto out; > > + } > > + > > + err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); > > +out: > > + return err; > > +} > > A 32 bit kernel should only need sys_mmap2, not sys_mmap, because it is > trivial to convert in user space. > > > + > > +asmlinkage long score_vfork(struct pt_regs *regs) > > +{ > > + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->regs[0], > > + regs, 0, NULL, NULL); > > +} > > + > > +/* > > + * Fork a new task - this creates a new program thread. > > + * This is called indirectly via a small wrapper > > + */ > > +asmlinkage int > > +score_fork(struct pt_regs *regs) > > +{ > > + return do_fork(SIGCHLD, regs->regs[0], regs, 0, NULL, NULL); > > +} > > Similarly, you should not need vfork and fork any more, because they can > be handled in user space through clone(). > OK, I remove these from my code. Best Regards liqin -- ?韬{.n?????%??檩??w?{.n???{饼??Ф?塄}?财??j:+v??????2??璀??摺?囤??z夸z罐?+?????w棹f