get the group ID
#include <sys/types.h> #include <unistd.h> gid_t getgid( void );
The getgid() function allows the calling process to find out its group ID.
The calling process's group ID. This function cannot fail.
/* * Print the group ID of the process. */ #include <stdio.h> #include <sys/types.h> #include <unistd.h> void main() { printf( "I belong to group ID %d\n", getgid() ); }
POSIX 1003.1
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
getuid(), geteuid(), getegid()