mirror of
https://github.com/fluencelabs/musl
synced 2025-07-31 06:11:57 +00:00
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.
9 lines
160 B
C
9 lines
160 B
C
#include <unistd.h>
|
|
#include "syscall.h"
|
|
#include "libc.h"
|
|
|
|
int setreuid(uid_t ruid, uid_t euid)
|
|
{
|
|
return __rsyscall(__NR_setreuid, ruid, euid, 0, 0, 0, 0);
|
|
}
|