>
> Instead of accusing me of starting a flame war, why don't you show me some
> code that's a nice a tacking a CLONED_STOPPED into clone_flags?
I just wanted to point out that it is dangerous ground.
Alan did already, but I repeat it:
[Given the glibc2 clone wrapper; untested]
void start_stopped_thread(void (*func)(void *), void *arg, void *stack)
{
struct arg {
void (*func)(void *);
void *real_arg;
} a;
pid_t pid;
int status;
a.func = func;
a.real_arg = arg;
pid = clone( trampoline, &a, stack, CLONE_VM | ... );
waitpid(pid, &status, WUNTRACED);
if (WIFSTOPPED(status)) {
...
}
}
void trampoline( void * f)
{
struct arg *a = (struct arg *) f;
kill(getpid(),SIGSTP);
a->func(a->real_arg);
}
It is essentially the same work the kernel would do for a CLONE_STOPPED, just
in user space.
-Andi
-- This is like TV. I don't like TV.- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/