about summary refs log tree commit diff
path: root/src/unistd/setresgid.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-06 20:27:07 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-06 20:27:07 -0400
commitb2486a8922bf4977bd82c8190258e39de28c053b (patch)
tree7e6a928a7fb8f84ab835ea9009ddb447487b44e4 /src/unistd/setresgid.c
parent74950b336d27532718428c7f5f98409c74f30819 (diff)
downloadmusl-b2486a8922bf4977bd82c8190258e39de28c053b.tar.gz
musl-b2486a8922bf4977bd82c8190258e39de28c053b.tar.xz
musl-b2486a8922bf4977bd82c8190258e39de28c053b.zip
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.
Diffstat (limited to 'src/unistd/setresgid.c')
-rw-r--r--src/unistd/setresgid.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/unistd/setresgid.c b/src/unistd/setresgid.c
index 3c85a828..2b0c96d8 100644
--- a/src/unistd/setresgid.c
+++ b/src/unistd/setresgid.c
@@ -5,6 +5,5 @@
 
 int setresgid(gid_t rgid, gid_t egid, gid_t sgid)
 {
-	if (libc.rsyscall) return libc.rsyscall(__NR_setresgid, rgid, egid, sgid, 0, 0, 0);
-	return syscall(SYS_setresgid, rgid, egid, sgid);
+	return __rsyscall(__NR_setresgid, rgid, egid, sgid, 0, 0, 0);
 }