From: Kenn H. <ke...@us...> - 2002-12-31 22:32:28
|
Update of /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel In directory sc8-pr-cvs1:/tmp/cvs-serv6407/kernel Modified Files: process.c Log Message: do_fork() now returns the struct task pointer rather than the PID. Userland is not allowed to use the new CLONE_IDLETASK flag. Index: process.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/arch/vax/kernel/process.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- process.c 12 Dec 2002 01:34:52 -0000 1.9 +++ process.c 31 Dec 2002 22:32:22 -0000 1.10 @@ -191,6 +191,7 @@ int sys_clone(unsigned long clone_flags, unsigned long newsp, struct pt_regs *regs) { int retval; + struct task_struct *p; if (!newsp) { newsp = regs->sp; @@ -199,22 +200,27 @@ printk("sys_clone: calling do_fork(0x%08lx, 0x%08lx, 0x%p)\n", clone_flags, newsp, regs); #endif - retval = do_fork(clone_flags, newsp, regs, 0); + p = do_fork(clone_flags & ~CLONE_IDLETASK, newsp, regs, 0); + retval = IS_ERR(p) ? PTR_ERR(p) : p->pid; #ifdef VAX_PROCESS_DEBUG - printk("sys_clone: do_fork() returned %d\n", retval); + printk("sys_clone: do_fork() returned %p, pid %d\n", p, retval); #endif return retval; } int sys_fork(struct pt_regs *regs) { - return do_fork(SIGCHLD, regs->sp, regs, 0); + struct task_struct *p; + p = do_fork(SIGCHLD, regs->sp, regs, 0); + return IS_ERR(p) ? PTR_ERR(p) : p->pid; } int sys_vfork(struct pt_regs *regs) { - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0); + struct task_struct *p; + p = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->sp, regs, 0); + return IS_ERR(p) ? PTR_ERR(p) : p->pid; } /* |