From 7196d9dfecaff4a8027fa706c6785bed06fb30cd Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 18 May 2003 21:45:28 -0700 Subject: [PATCH] fix do_fork() return value Noticed by Julie DeWandel . do_fork() needs to return the pid (or error), not the pointer to the resulting process structure. The process structure may not even be valid any more, since do_fork() has already woken the process up (and as a result it might already have done its thing and gone away). Besides, doing it this way cleans up the users, which all really just wanted the pid or error number _anyway_. This fixes the x86 users, other architectures need to be fixed up as well. --- include/linux/sched.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/linux/sched.h') diff --git a/include/linux/sched.h b/include/linux/sched.h index ade36c734af0..46981bca766f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -637,7 +637,8 @@ extern int allow_signal(int); extern task_t *child_reaper; extern int do_execve(char *, char __user * __user *, char __user * __user *, struct pt_regs *); -extern struct task_struct *do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); +extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); +extern struct task_struct * copy_process(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); #ifdef CONFIG_SMP extern void wait_task_inactive(task_t * p); -- cgit v1.2.3