`setuid` is a file permission flag under Unix-like systems that will run an executable with the file owner's permissions rather than the invoking user's. On some systems (FreeBSD), it further works identically to the related `setgid` flag on directories, causing new files to inherit the directory's permissions rather than the current user's.
Is there a way to change UID/GID only of one thread in a multithreaded process? The reason for this …
linux pthreads setuid