get the group ID
#include <sys/types> #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.
getuid(), geteuid(), getegid()
/*
* print out group id of 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
QNX