From b2486a8922bf4977bd82c8190258e39de28c053b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 6 Apr 2011 20:27:07 -0400 Subject: 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. --- src/unistd/setuid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/unistd/setuid.c') diff --git a/src/unistd/setuid.c b/src/unistd/setuid.c index 61e8be55..da6816de 100644 --- a/src/unistd/setuid.c +++ b/src/unistd/setuid.c @@ -4,6 +4,5 @@ int setuid(uid_t uid) { - if (libc.rsyscall) return libc.rsyscall(__NR_setuid, uid, 0, 0, 0, 0, 0); - return syscall(SYS_setuid, uid); + return __rsyscall(__NR_setuid, uid, 0, 0, 0, 0, 0); } -- cgit v1.2.1