setegid(3)
DESCRIPTION
Sets the process effective group ID to gid without changing the real group ID.
SYNOPSIS
#include <unistd.h> int setegid(gid_t gid);
RETURN VALUE
- Returns zero, or -1 and sets errno.
ERRORS
-EINVAL- Gid cannot be represented by the direct ABI.
-EPERM- The requested transition is not allowed for the current effective GID.
-ESRCH- The calling process does not exist.
NOTES
The kernel permits a non‑root process to select its current real or effective GID.