move rsyscall out of pthread_create module

this is something of a tradeoff, as now set*id() functions, rather
than pthread_create, are what pull in the code overhead for dealing
with linux's refusal to implement proper POSIX thread-vs-process
semantics. my motivations are:

1. it's cleaner this way, especially cleaner to optimize out the
rsyscall locking overhead from pthread_create when it's not needed.
2. it's expected that only a tiny number of core system programs will
ever use set*id() functions, whereas many programs may want to use
threads, and making thread overhead tiny is an incentive for "light"
programs to try threads.
This commit is contained in:
Rich Felker
2011-04-06 20:27:07 -04:00
parent 74950b336d
commit b2486a8922
10 changed files with 133 additions and 109 deletions

View File

@ -10,7 +10,6 @@ struct __libc {
void (*lock)(volatile int *);
void (*lockfile)(FILE *);
void (*fork_handler)(int);
int (*rsyscall)(int, long, long, long, long, long, long);
int (*atexit)(void (*)(void));
void (*fini)(void);
void (*ldso_fini)(void);
@ -48,6 +47,8 @@ void __lockfile(FILE *);
#define CANCELPT_INHIBIT CANCELPT(2)
#define CANCELPT_RESUME CANCELPT(-2)
int __rsyscall(int, long, long, long, long, long, long);
extern char **__environ;
#define environ __environ