The "effecive user/group ID" of a process is what the OS uses to determine whether an action (such as opening a file) is permitted by the process. You can set the effective primary GID of the current process using
setegid, which can only be used by superusers (or if given the capability) to lower privileges temporarily.
Supplementary GIDs are additional groups that are also used to check if an action is permitted by a process. For example, if a file is located under a directory structure
/A/B/C/file.txt, and directories
C have read-access locked to their owners
groupC respectively, the process would need all 3 groups in their supplementary groups or effective GID.
There is a
setgroups syscall which is analogous to
setgid, meaning it changes the environment of the process permanently. Is there no need for an "effective" syscall of supplementary groups (i.e.