diff options
| author | Ingo Molnar <mingo@elte.hu> | 2003-05-18 21:45:28 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-05-18 21:45:28 -0700 |
| commit | 7196d9dfecaff4a8027fa706c6785bed06fb30cd (patch) | |
| tree | ff80e409f82fb1b4c6521832138016b6df0025d2 /include | |
| parent | c6b523ab3aed9b6a183e7a9982f11eda9567af96 (diff) | |
[PATCH] fix do_fork() return value
Noticed by Julie DeWandel <jdewand@redhat.com>.
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.
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/sched.h | 3 |
1 files changed, 2 insertions, 1 deletions
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); |
