Group ID values can be altered according to the same rules as user ID values. For completeness, these functions are shown in the following sections.
The functions setgid(2) and setegid(2) establish the new real and effective group ID values, respectively. The function synopsis is as follows:
#include <sys/types.h> #include <unistd.h> int setgid(gid_t gid); int setegid(gid_t egid);
These functions return 0 when successful. Otherwise, -1 is returned, and an error code is available in errno.
3.144.37.38