Ok, I understand now.
1. You need the child to have a valid thread descriptor immediately after
fork(), and the parent's thread descriptor to be the same
before and after fork().
2. At all times, get_current_thread()->tid must return the current
thread's tid in both the parent and child.
That is fine. Just allocate a new TLS for the child, use
CLONE_SETTID|CLONE_CLEARTID|CLONE_SETTLS in your threaded fork(), and
pass the child's tid address (in the child's tls area).
It does require allocating a new TLS area on fork(). Is that a
problem?
cheers,
-- Jamie
-
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/