Standards / Extensions | C or C++ | Dependencies |
---|---|---|
POSIX.1 |
both |
#define _POSIX_SOURCE
#include <unistd.h>
gid_t getegid(void);
Finds the effective group ID (GID) of the calling process.
Returns the effective group ID (GID). It is always successful.
There are no documented errno values.
⁄* CELEBG04
This example finds the group ID.
*⁄
#define _POSIX_SOURCE
#include <stdio.h>
#include <sys⁄types.h>
#include <unistd.h>
main() {
printf("my group id is %d\n", (int) getgid());
}
my group id is 500