Function rustix::thread::id::set_thread_groups

source ·
pub fn set_thread_groups(groups: &[Gid]) -> Result<()>
Expand description

setgroups(groups)-Sets the supplementary group IDs for the calling thread.

§Warning

This is not the setgroups you are looking for… POSIX requires gids to be process granular, but on Linux they are per-thread. Thus, this call only changes the gids for the current thread, not the entire process even though that is in violation of the POSIX standard.

For details on this distinction, see the C library vs. kernel differences in the manual page. This call implements the kernel behavior.

§References