lkml.org 
[lkml]   [2003]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] fix do_fork() return value
Date
# 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_.

Just FYI: the change was done in the first place to allow spawning a
new init thread as CPUs come up. But now we have copy_process it can
be done neatly (it should also be done out of keventd so we get a
clean thread, but that's another story).

Note that this version also has a (theoretical) race, except hidden
by the time to wrap PIDs ie. "never happens".

Thanks!
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.035 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site