getgid()

NAME

getgid(), getegid() - get group process identification

SYNOPSIS

#include <unistd.h>

gid_t getgid (void) gid_t getegid (void)

DESCRIPTION

The getgid(2) function returns the real group ID of the calling process, getegid(2) returns the effective group ID of the calling process.

The real group ID is the group of the user who invoked the program. The real group ID is specified at login time.

The effective group ID is the group of the process, if it has the set-group-ID mode set. Since the effective group ID gives the process additional permissions during execution, getgid(2) is used to determine the real-user-id of the calling process.

ERRORS

The getgid(2) and getegid(2) functions are always successful, and no return value is reserved to indicate an error.

SEE ALSO

getuid(2)

setgid(2)