overhaul clone syscall wrapping
authorRich Felker <dalias@aerifal.cx>
Sun, 18 Sep 2011 14:14:37 +0000 (10:14 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 18 Sep 2011 14:14:37 +0000 (10:14 -0400)
commit3f72cdac73030761120cf32aeef44e7d03e2f1fa
treed52dde9adbb8386100d98371d4e954fb88af2c41
parent455fc98389fac09d8cf7ec4cde310a5b7ca47485
overhaul clone syscall wrapping

several things are changed. first, i have removed the old __uniclone
function signature and replaced it with the "standard" linux
__clone/clone signature. this was necessary to expose clone to
applications anyway, and it makes it easier to port __clone to new
archs, since it's now testable independently of pthread_create.

secondly, i have removed all references to the ugly ldt descriptor
structure (i386 only) from the c code and pthread structure. in places
where it is needed, it is now created on the stack just when it's
needed, in assembly code. thus, the i386 __clone function takes the
desired thread pointer as its argument, rather than an ldt descriptor
pointer, just like on all other sane archs. this should not affect
applications since there is really no way an application can use clone
with threads/tls in a way that doesn't horribly conflict with and
clobber the underlying implementation's use. applications are expected
to use clone only for creating actual processes, possibly with new
namespace features and whatnot.
include/sched.h
src/internal/pthread_impl.h
src/thread/__set_thread_area.c
src/thread/clone.c
src/thread/forkall.c
src/thread/i386/__set_thread_area.s
src/thread/i386/clone.s
src/thread/pthread_create.c
src/thread/x86_64/clone.s